I think this is one of the hardest concept for me to understand with angularjs’s directive. The document from http://docs.angularjs.org/guide/directive says: transclude – compile the content of the element...
I’m trying to build a directive that takes care of adding more directives to the element it is declared on. For example, I want to build a directive that...
I have a list of items in my view with ng-click attached to them: <ul id="team-filters"> <li ng-click="foo($event, team)" ng-repeat="team in teams"> <img src="https://stackoverflow.com/questions/23107613/{{team.logoSmall}}" alt="{{team.name}}" title="{{team.name}}"> </li> </ul> I’m...
I need to perform some operations on scope and the template. It seems that I can do that in either the link function or the controller function (since both...
I have a very boiled down version of what I am doing that gets the problem across. I have a simple directive. Whenever you click an element, it adds...
I’m trying to set the src attribute of an iframe from a variable and I can’t get it to work… The markup: <div class="col-xs-12" ng-controller="AppCtrl"> <ul class=""> <li ng-repeat="project...
I’m looking for some guidelines that one can use to help determine which type of scope to use when writing a new directive. Ideally, I’d like something similar to...
I have seen a number of questions on StackOverflow discussing ng-transclude, but none explaining in layman’s terms what it is. The description in the documentation is as follows: Directive...
I am handling my issue like this: ng-style="{ width: getTheValue() }" But to avoid having this function on the controller side, I would much prefer to do something like...
I have a directive, here is the code : .directive('map', function() { return { restrict: 'E', replace: true, template: '<div></div>', link: function($scope, element, attrs) { var center = new...