1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | angular.module('TEST').directive('helloWorld', function() { return { scope:{ name : '=', nameStatic : '@', select : '&' }, restrict: 'AEC', replace: 'true', template: '<p ng-click="select()">Hello World!! {{name}} {{nameStatic}}</p>', link: function(scope, element, attributs){ console.log(attributs.nameStatic); } }; }); |
1 2 | $("body").append("<hello-world name-static='Parametre statique' select='testDirective()' id='screenshot'/>"); |
--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.
--
$scope.onMouseEnter = function ($event) { var coords = getMouseEventResult($event, "Mouse move");
var newElement = $compile('div id="screenshot"> <muse:hello-world name-static="Parametre statique2" select="testDirective()"/></div>')($scope); angular.element(document.body).append(newElement); };Ok I found
var newElement = $compile('<div id="screenshot"> <muse:hello-world name="row.Name" name-static="Parametre statique" select="testDirective()"/></div>')($scope); angular.element(document.body).append(newElement);