www.pudn.com > TeachingPlatform.zip > testAngularDirective.js, change:2016-11-21,size:504b


angular.module('myApp', []) 
    .directive('helloDirective', function () { 
        return { 
            restrict: 'E', 
            templateUrl: 'directive.html', 
            replace: true, 
            controller:function ($scope) { 
                $scope.sayHello=function () { 
                    console.log($scope.name) 
                    $scope.name='origin' 
                } 
            } 
        } 
    }) 
    .controller('testController', function ($rootScope, $scope) { 
 
    })