I use beta.0 because this outstanding error prevents angular 2 from working in IE in beta and beta .2.
Relevant code from SearchBar.ts
@Component({
selector : 'search-bar',
templateUrl: 'views/searchbar.html'
})
export class SearchBar {
private history: SearchHistoryEntry[] = [];
@Output() onHistory = new EventEmitter();
constructor() {
this.history = JSON.parse(localStorage.getItem('SearchHistory')) || [];
}
ngOnInit() {
debugger;
this.onHistory.emit(this.history);
}
}
Relevant code from home.html
<search-bar (onHistory)="SearchBarHistory($event)"></search-bar>
Relevant code from home.ts
SearchBarHistory(history: SearchHistoryEntry[]) {
debugger;
this.history = history;
}
On Chrome, this works fine. The SearchBar constructor reads correctly from localStorage, into ngOnInitit emits my home component, which receives it, it is stored locally, and the user interface bindings are bound to historyupdate to show the information, like everyone else.
IE 11 . ngOnInit , . , @Input ( , ngOnInit, ngAfterContentInit ngAfterViewInit, ) , . , , Chrome, @Input , , , .
, -, - , ?