javascript - Parameter property declaration with open ended constructor arguments -
is possible ?
what have , works:
module app.typescriptdemoview { export class initializeautocomplete { constructor(... _inputids: string[]) { // initialize _inputids fellow member variable .. } } } what achieve:
module app.typescriptdemoview { export class initializeautocomplete { constructor(private ... _inputids: string[]) { // automatic fellow member var. initialization } } }
it isn't possible, stuck manually assigning it. compiler need alter automatically.
class test { private _args: string[]; constructor (...args: string[]) { this._args = args; } } javascript typescript
No comments:
Post a Comment