Angular.js 입문

angular.js 도입
     


2.정의 컨트롤 러,모듈


    


"</span><span style="color: #800000;">text/javascript</span><span style="color: #800000;">"</span>>
        <span style="color: #0000ff;">var</span> app = angular.module(<span style="color: #800000;">'</span><span style="color: #800000;">eshop</span><span style="color: #800000;">'</span><span style="color: #000000;">,[]);
        app.controller(</span><span style="color: #800000;">'</span><span style="color: #800000;">brandController</span><span style="color: #800000;">'</span><span style="color: #000000;">,function($scope,$http){
            </span><span style="color: #008000;">//</span><span style="color: #008000;">      </span>
            $scope.findAll=<span style="color: #000000;"> function(){
                $http.</span><span style="color: #0000ff;">get</span>(<span style="color: #800000;">'</span><span style="color: #800000;">../brand/getAllBrand.do</span><span style="color: #800000;">'</span><span style="color: #000000;">).success(
                    function(res){
                        $scope.list </span>=<span style="color: #000000;"> res;
                    }        
                )
            }
        });
    </span> 
 

、 body

class="hold-transition skin-red sidebar-mini" ng-app="eshop" ng-controller="brandController" ng-init="findAll()">


4,대응 하 는 목록 에

표시
                                  
                                      
                                                                                    
                                          {{entity.id}}
                                          {{entity.name}}                                         
                                          {{entity.firstChar}}                                         
                                          class="text-center">                                           
                                                                                          
                                          
                                      
                                  


 







좋은 웹페이지 즐겨찾기