angularjs 명령 - 컨트롤러

1361 단어 angularjs
1. 지령-컨트롤러.html



    
    angularjs 
    
    
    
    



    
    
    


    var app = angular.module('kongwc',[]);
    app.directive('qingWei',function () {
        return {
            restrict : 'E',
            replace : true,
            templateUrl : 'table.html',
           controller : (function ($scope) {
               $scope.datas = [
                   { id: "1", name : " ", phone : "13465352119" },
                   { id: "2", name : " ", phone : "1565354662" },
                   { id: "3", name : " ", phone : "13765354891" }
               ];
           })
        }
    });


2.table.html
{{data.id}} {{data.name}} {{data.phone}}

좋은 웹페이지 즐겨찾기