Trouble with angularjs and setting up a custom repeater directive -
i'd make custom repeater hang on how custom directives work , i'm not getting errors or warnings i'm not seeing console log either. missing?
html
<ion-item data-ng-repeat="object in objects" customrepeater> <p>{{ object }}</p> </ion-item>
directive
angular.module('starter', ['ionic', 'starter.controllers', 'ngcordova']) .directive("customrepeater", function() { return { compile: function(element, attr) { return function($scope, $element, $attr) { console.log("log: ", arguments); }; } }; })
if name directive customrepeater
, camelcase notation, in markup need attach element without camelcase
<ion-item hdata-ng-repeat="object in objects" custom-repeater> <p>{{ object }}</p> </ion-item>
Comments
Post a Comment