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
|
||||
'rxjs': 'npm:rxjs',
|
||||
'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',
|
||||
'typescript': 'npm:typescript@2.0.3/lib/typescript.js',
|
||||
'ts': 'npm:plugin-typescript@5.2.7/lib/plugin.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
|
||||
|
|
|
@ -49,8 +49,8 @@
|
|||
// other libraries
|
||||
'rxjs': 'npm:rxjs',
|
||||
'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',
|
||||
'typescript': 'npm:typescript@2.0.3/lib/typescript.js',
|
||||
'ts': 'npm:plugin-typescript@5.2.7/lib/plugin.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
|
||||
|
|
|
@ -3,18 +3,16 @@ import { Component, Input } from '@angular/core';
|
|||
|
||||
@Component({
|
||||
selector: 'name-child',
|
||||
template: `
|
||||
<h3>"{{name}}"</h3>
|
||||
`
|
||||
template: '<h3>"{{name}}"</h3>'
|
||||
})
|
||||
export class NameChildComponent {
|
||||
_name: string = '<no name set>';
|
||||
private _name = '';
|
||||
|
||||
@Input()
|
||||
set name(name: string) {
|
||||
this._name = (name && name.trim()) || '<no name set>';
|
||||
}
|
||||
|
||||
get name() { return this._name; }
|
||||
get name(): string { return this._name; }
|
||||
}
|
||||
// #enddocregion
|
||||
|
|
|
@ -4,10 +4,8 @@ import { Component } from '@angular/core';
|
|||
@Component({
|
||||
selector: 'name-parent',
|
||||
template: `
|
||||
<h2>Master controls {{names.length}} names</h2>
|
||||
<name-child *ngFor="let name of names"
|
||||
[name]="name">
|
||||
</name-child>
|
||||
<h2>Master controls {{names.length}} names</h2>
|
||||
<name-child *ngFor="let name of names" [name]="name"></name-child>
|
||||
`
|
||||
})
|
||||
export class NameParentComponent {
|
||||
|
|
|
@ -81,7 +81,7 @@
|
|||
"style-loader": "^0.13.1",
|
||||
"ts-node": "^1.3.0",
|
||||
"tslint": "^3.15.1",
|
||||
"typescript": "^2.0.3",
|
||||
"typescript": "^2.0.10",
|
||||
"webdriver-manager": "10.2.5",
|
||||
"webpack": "^1.13.0",
|
||||
"webpack-dev-server": "^1.14.1",
|
||||
|
|
Loading…
Reference in New Issue