AngularJS - Using Directive in template -
i have question custom directive.
is possible
create custom directive provide templateurl attribute , in template url create utilize ofng-grid
attribute ? i tried although grid not getting rendered if declared in template. how template code looks like
<div class="gridstyle" ng-grid="gridoptions"> </div>
and controller code within custom directive looks
treeapp.controller('treecontroller',function ($scope, $http,treefactory) { console.log("calling controller"); treefactory.gettreedata().success(function(data){ $scope.mydata = data; $scope.gridoptions = { data: 'mydata' }; });;
and how custom directive looks like
treeapp.directive('ngtree', function(treefactory) { homecoming { restrict: 'a', require: '^ngmodel', templateurl: 'js/angular/templates/ngtree-template.html', });
angularjs-directive
No comments:
Post a Comment