
This commit was worked on by a number of people including @filipesilva, @gkalpak and @wardbell. It contains changes that: * remove unused files, * fix the bootstrap approach to ensure that bootstrap is in the correct Zone * fix unclosed code-example tags * replace use of "we" with "you" * remove broken dual router example Related to angular/angular.io#3541
23 lines
494 B
TypeScript
23 lines
494 B
TypeScript
// #docregion
|
|
export function heroDetailDirective() {
|
|
return {
|
|
restrict: 'E',
|
|
scope: {},
|
|
bindToController: {
|
|
hero: '=',
|
|
deleted: '&'
|
|
},
|
|
template: `
|
|
<h2>{{$ctrl.hero.name}} details!</h2>
|
|
<div><label>id: </label>{{$ctrl.hero.id}}</div>
|
|
<button ng-click="$ctrl.onDelete()">Delete</button>
|
|
`,
|
|
controller: function() {
|
|
this.onDelete = () => {
|
|
this.deleted({hero: this.hero});
|
|
};
|
|
},
|
|
controllerAs: '$ctrl'
|
|
};
|
|
}
|