خرید بک لینک

Vote count: 0

my controller is-

var App = angular.module("App",[]);
App.controller("MainController",['$scope',function($scope){
   $scope.getDetail = function(){
      console.log("get detail call from main controller");
   }
}]);

directive is-

App.directive('customDirective',[function(){
   retu {
      restrict : 'EAC',
      scope : {
      },
      template :'<div><button type="button">click here to get detail</button></div>',
     link : function(scope,element,attribute){

     }
   };
}]);

page html is-

 <div ng-controller="MainController">
        <custom-directive></custom-directive>
    </div>

i am trying to call the getDetail in MainController on click of button inside the custom directive.

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: جمعه 17 ارديبهشت 1395 ساعت: 13:25

صفحه بندی