chore(cb-component-communication): tweak code/update TS version (#2900)
Simplify name-child component. Update TS version in package.json and the web systemjs.configs Inspired by issue #2881
This commit is contained in:
parent
56e6513659
commit
efcb906981
|
@ -62,8 +62,8 @@
|
||||||
// other libraries
|
// other libraries
|
||||||
'rxjs': 'npm:rxjs',
|
'rxjs': 'npm:rxjs',
|
||||||
'angular-in-memory-web-api': 'npm:angular-in-memory-web-api/bundles/in-memory-web-api.umd.js',
|
'angular-in-memory-web-api': 'npm:angular-in-memory-web-api/bundles/in-memory-web-api.umd.js',
|
||||||
'ts': 'npm:plugin-typescript@4.0.10/lib/plugin.js',
|
'ts': 'npm:plugin-typescript@5.2.7/lib/plugin.js',
|
||||||
'typescript': 'npm:typescript@2.0.3/lib/typescript.js',
|
'typescript': 'npm:typescript@2.0.10/lib/typescript.js',
|
||||||
|
|
||||||
},
|
},
|
||||||
// packages tells the System loader how to load when no filename and/or no extension
|
// packages tells the System loader how to load when no filename and/or no extension
|
||||||
|
|
|
@ -49,8 +49,8 @@
|
||||||
// other libraries
|
// other libraries
|
||||||
'rxjs': 'npm:rxjs',
|
'rxjs': 'npm:rxjs',
|
||||||
'angular-in-memory-web-api': 'npm:angular-in-memory-web-api/bundles/in-memory-web-api.umd.js',
|
'angular-in-memory-web-api': 'npm:angular-in-memory-web-api/bundles/in-memory-web-api.umd.js',
|
||||||
'ts': 'npm:plugin-typescript@4.0.10/lib/plugin.js',
|
'ts': 'npm:plugin-typescript@5.2.7/lib/plugin.js',
|
||||||
'typescript': 'npm:typescript@2.0.3/lib/typescript.js',
|
'typescript': 'npm:typescript@2.0.10/lib/typescript.js',
|
||||||
|
|
||||||
},
|
},
|
||||||
// packages tells the System loader how to load when no filename and/or no extension
|
// packages tells the System loader how to load when no filename and/or no extension
|
||||||
|
|
|
@ -3,18 +3,16 @@ import { Component, Input } from '@angular/core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'name-child',
|
selector: 'name-child',
|
||||||
template: `
|
template: '<h3>"{{name}}"</h3>'
|
||||||
<h3>"{{name}}"</h3>
|
|
||||||
`
|
|
||||||
})
|
})
|
||||||
export class NameChildComponent {
|
export class NameChildComponent {
|
||||||
_name: string = '<no name set>';
|
private _name = '';
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
set name(name: string) {
|
set name(name: string) {
|
||||||
this._name = (name && name.trim()) || '<no name set>';
|
this._name = (name && name.trim()) || '<no name set>';
|
||||||
}
|
}
|
||||||
|
|
||||||
get name() { return this._name; }
|
get name(): string { return this._name; }
|
||||||
}
|
}
|
||||||
// #enddocregion
|
// #enddocregion
|
||||||
|
|
|
@ -5,9 +5,7 @@ import { Component } from '@angular/core';
|
||||||
selector: 'name-parent',
|
selector: 'name-parent',
|
||||||
template: `
|
template: `
|
||||||
<h2>Master controls {{names.length}} names</h2>
|
<h2>Master controls {{names.length}} names</h2>
|
||||||
<name-child *ngFor="let name of names"
|
<name-child *ngFor="let name of names" [name]="name"></name-child>
|
||||||
[name]="name">
|
|
||||||
</name-child>
|
|
||||||
`
|
`
|
||||||
})
|
})
|
||||||
export class NameParentComponent {
|
export class NameParentComponent {
|
||||||
|
|
|
@ -81,7 +81,7 @@
|
||||||
"style-loader": "^0.13.1",
|
"style-loader": "^0.13.1",
|
||||||
"ts-node": "^1.3.0",
|
"ts-node": "^1.3.0",
|
||||||
"tslint": "^3.15.1",
|
"tslint": "^3.15.1",
|
||||||
"typescript": "^2.0.3",
|
"typescript": "^2.0.10",
|
||||||
"webdriver-manager": "10.2.5",
|
"webdriver-manager": "10.2.5",
|
||||||
"webpack": "^1.13.0",
|
"webpack": "^1.13.0",
|
||||||
"webpack-dev-server": "^1.14.1",
|
"webpack-dev-server": "^1.14.1",
|
||||||
|
|
Loading…
Reference in New Issue