Sha256: 34b097b8f4db9361313caf334fb7102159c487c9b69ea76402deb55505973b1d
Contents?: true
Size: 1.96 KB
Versions: 113
Compression:
Stored size: 1.96 KB
Contents
angular.module 'NgRepeatList', ['Factories'] .directive 'ngRepeatList', -> restrict: 'A', replace: true link: (scope, element, attributes) -> filters = attributes.ngRepeatList.split('|') parsed = filters.splice(0,1)[0].split(' in ') factory = parsed.pop().replace(/\s+/g, '') element.parent().addClass('loading') list = element.injector().get(factory) context = {} if attributes.ngContext name = attributes.ngContext if name.match(/\_id$/) watch = name else watch = name + '.id' name += "_id" scope.$watch watch, (newVal) -> if newVal context[name] = eval("scope." + watch) list.index context, (data) -> scope[factory] = data element.parent().removeClass('loading') else list.index context, (data) -> scope[factory] = data element.parent().removeClass('loading') template: (element, attributes) -> element[0].setAttribute('ng-repeat', attributes.ngRepeatList) element[0].removeAttribute('ng-repeat-list') html = element[0].outerHTML return html .directive 'ngRepeatStartList', -> restrict: 'A', replace: true link: (scope, element, attributes) -> filters = attributes.ngRepeatStartList.split('|') parsed = filters.splice(0,1)[0].split(' in ') factory = parsed.pop().replace(/\s+/g, '') element.parent().addClass('loading') list = element.injector().get(factory) context = {} context[attributes.ngContext + '_id'] = scope[attributes.ngContext].id if attributes.ngContext list.index context, (data) -> scope[factory] = data element.parent().removeClass('loading') template: (element, attributes) -> element[0].setAttribute('ng-repeat-start', attributes.ngRepeatStartList) element[0].removeAttribute('ng-repeat-start-list') html = element[0].outerHTML return html
Version data entries
113 entries across 113 versions & 1 rubygems