This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('setAttr',[]).directive('setAttr', function() { | |
return { | |
restrict: 'A', | |
priority: 100, | |
link: function(scope,elem,attrs) { | |
if(attrs.setAttr.indexOf('{') != -1 && attrs.setAttr.indexOf('}') != -1) { | |
//you could just angular.isObject(scope.$eval(attrs.setAttr)) for the above but I needed it this way | |
var data = scope.$eval(attrs.setAttr); | |
angular.forEach(data, function(v,k){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('setIf',[]).directive('setIf',function () { | |
return { | |
transclude: 'element', | |
priority: 1000, | |
terminal: true, | |
restrict: 'A', | |
compile: function (element, attr, linker) { | |
return function (scope, iterStartElement, attr) { | |
if(attr.waitFor) { | |
var wait = scope.$watch(attr.waitFor,function(nv,ov){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('setRepeat',[]).directive('setRepeat', function () { | |
return { | |
transclude: 'element', | |
priority: 1000, | |
compile: compileFun | |
}; | |
function compileFun(element, attrs, linker) { | |
var expression = attrs.setRepeat.split(' in '); |