Created
July 30, 2019 15:43
-
-
Save RangerRick/0d5de383f186d34abbff2ed8003d82cd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"presets": [ | |
["@babel/preset-env", { | |
"targets": { | |
"node": "current", | |
"browsers": [ "last 2 versions", "safari >= 7", "> 5%" ] | |
}, | |
"modules": "umd", | |
"useBuiltIns": "usage", | |
"corejs": 2 | |
}], | |
"@babel/preset-typescript" | |
], | |
"plugins": [ | |
"angularjs-annotate", | |
["module-resolver", { | |
"root": [ | |
"src/main/assets/modules", | |
"src/main/assets/js", | |
"src/main/assets/style", | |
"node_modules" | |
] | |
}], | |
["@babel/plugin-transform-runtime", { | |
"corejs": 2, | |
"helpers": false, | |
"regenerator": true | |
}], | |
"@babel/plugin-proposal-async-generator-functions", | |
"@babel/plugin-proposal-class-properties", | |
"@babel/plugin-proposal-object-rest-spread", | |
"@babel/plugin-transform-destructuring", | |
"@babel/plugin-transform-for-of", | |
"@babel/plugin-transform-modules-commonjs", | |
"@babel/plugin-transform-regenerator" | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abstract class ParentClass { | |
private hash?: string; | |
constructor() { | |
this.generateHash(); | |
} | |
protected generateHash() { | |
this.hash = Math.random().toString(6); | |
this.onNewHash(this.hash); | |
} | |
protected onNewHash(newHash?: string) { | |
} | |
} | |
class SubClass extends ParentClass { | |
public computedString?: string; | |
constructor() { | |
super(); | |
} | |
protected onNewHash(newHash?: string) { | |
super.onNewHash(newHash); | |
this.computedString = 'Basic ' + newHash; | |
} | |
} | |
const sc = new SubClass(); | |
console.log(sc.computedString); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"compilerOptions": { | |
"target": "es6", | |
"module": "commonjs", | |
"moduleResolution": "node", | |
"allowSyntheticDefaultImports": true, | |
"esModuleInterop": true, | |
"experimentalDecorators": true, | |
"sourceMap": true, | |
"allowJs": true, | |
"lib": [ "es6", "dom" ], | |
"skipLibCheck": true, | |
"outDir": "dist" | |
}, | |
"include": [ | |
"src" | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment