Logo
Explore Help
Sign In
honeymoose/angular-cn
1
0
Fork 0
You've already forked angular-cn
Code Issues Pull Requests Actions Packages Projects Releases Wiki Activity
angular-cn/public/docs/_examples/upgrade-adapter/ts/app/hero-detail.directive.ts

23 lines
489 B
TypeScript
Raw Normal View History

docs(upgrade) extend upgrade guide with UpgradeAdapter and preparation coverage closes #629 Also make minor improvements into the PhoneCat tutorial
2015-12-31 08:46:32 +02:00
// #docregion
export function heroDetailDirective() {
return {
docs(upgrade): restrict component directive to elements The `heroDetail` directive is shown as an example of a component directive, such as those built using the `.component()` helper in v1.5+. In order for the directive to be functionaly equivalent with the component directive created with `.component`, it needs to be restricted to elements only. (If the `restrict` is omitted, it defaults to `'AE'`, which would also match attributes.) /cc @teropa
2016-06-05 14:59:19 +03:00
restrict: 'E',
docs(upgrade) extend upgrade guide with UpgradeAdapter and preparation coverage closes #629 Also make minor improvements into the PhoneCat tutorial
2015-12-31 08:46:32 +02:00
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'
}
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.8 Page: 81ms Template: 3ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API