Monday 15 August 2011

javascript - Directive Title AngularJS not it works -



javascript - Directive Title AngularJS not it works -

i wonder of experience in angularjs, possible create directive title of page. title comes database , bringing through ng-model. every time create directive him carry title application function, if not run directive.

<!-- index.html --> <!doctype html> <html lang="en" id="ng-app" ng-app="app-work"> <head> <meta charset="utf-8"> <titlepage></titlepage> </head> <body> </body> </html> <!-- directive --> app.directive('titlepage', [function () { homecoming { restrict: 'e', replace: true, templateurl: 'partials/directives/titlepage.html', scope: { titleapp: '=' } }; }]) <!-- pagetitle.html --> <title ng-model="app.title"></title>

instead of ng-model should interpolation.

<!-- index.html --> <!doctype html> <html lang="en" id="ng-app" ng-app="app-work"> <head> <meta charset="utf-8"> <titlepage></titlepage> </head> <body> </body> </html> <!-- directive --> app.directive('titlepage', [function () { homecoming { restrict: 'e', replace: true, templateurl: 'partials/directives/titlepage.html', scope: { titleapp: '=' } }; }]) <!-- pagetitle.html --> <title>{{app.title}}</title>

javascript angularjs

No comments:

Post a Comment