angularjs ui routing 적용

angularjs ui routing 적용

  1. 메뉴 추가 및 컨트롤러 없는 html 적용 # 해시맵 사용
    /src/main/resources/static/index.html
    /src/main/resources/static/home.html
    /src/main/resources/static/company.html
    /src/main/resources/static/js/hello.js
  2. <!doctype html>
    <html>
    <head>
    <title>Hello AngularJS</title>
    <link href="css/angular-bootstrap.css" rel="stylesheet">
    <style type="text/css">
    [ng\:cloak], [ng-cloak], .ng-cloak {
     display: none !important;
    }
    </style>
    </head>
    
    <body ng-app="hello">
     <div class="container">
      <h1>Greeting</h1>
      <div ng-controller="homeController as home" ng-cloak class="ng-cloak">
       <p>The ID is {{home.greeting.id}}</p>
       <p>The content is {{home.greeting.content}}</p>
       <a href="#/home">home</a> |
       <a href="#/company">company</a> <br>
       <div ng-view></div>
      </div>
     </div>
     <script src="js/angular-bootstrap.js" type="text/javascript"></script>
     <script src="js/hello.js"></script>
    </body>
    </html>
    

댓글