2017-02-27 10 views
0

私はAngular 1.4を使ってアプリケーションを開発しようとしています(下の画像参照)。私は以下の提案が必要ですAngular1アプリにRouteproviderとstateproviderを一緒に

  • これでホームページを開発する最良の方法は何ですか? <ui-view>(UIルーティング)を使用して8つの状態を作成するか、タブ(タブ1、タブ2、タブ3など)に8つの異なるカスタムディレクティブを使用する必要があります。
  • 設定ファイルにrouteproviderとstateprovider (Another post from Stackoverflow

---------------------------------------- ----------------------------------->

私の意見/これを開発するためのアイデア--- →

  • ng-viewは、ページ(ホーム、NAV3、NAV2、など)をロードする

image for Angular 1.4 application

ホームページ(TAB1、TAB2、TAB3、など)の内側のタブ/パネルをロードするために ui-viewを使用することになります
  • 答えて

    0

    両方を使用ng-viewui-viewはいずれもファイルに結果を表示していません。アプリがクラッシュします。すべての状態を表示するにはui-viewに移動しました。

    以下は、正常に動作するコードです。 Tutorial

    .config(function($urlRouterProvider, $stateProvider) { 
     
         $urlRouterProvider.otherwise('/home'); 
     
         $stateProvider 
     
         .state("home", { 
     
          url:"/home", 
     
          views:{ 
     
          "":{ 
     
           templateUrl: "views/home.html" 
     
          }, 
     
          "[email protected]":{ 
     
           templateUrl: "views/home/profile.html" 
     
          }, 
     
          "[email protected]":{ 
     
           templateUrl: "views/home/company-announcement.html" 
     
          }, 
     
          "[email protected]":{ 
     
           templateUrl: "views/home/leave-balance.html" 
     
          }, 
     
          "[email protected]":{ 
     
           templateUrl: "views/home/leave-details.html" 
     
          }, 
     
          "[email protected]":{ 
     
           templateUrl: "views/home/attendence-details.html" 
     
          }, 
     
          "[email protected]":{ 
     
           templateUrl: "views/home/holiday-list.html" 
     
          }, 
     
          "[email protected]":{ 
     
           templateUrl: "views/home/query-status.html" 
     
          }, 
     
          "[email protected]":{ 
     
           templateUrl: "views/home/payrol-query-status.html" 
     
          } 
     
          }//views ends here 
     
         }) 
     
         .state("login", { 
     
          url: "/login", 
     
          templateUrl: "views/login.html" 
     
         }) 
     
         .state("selfService", { 
     
          url:"/self-service", 
     
          views:{ 
     
          "":{ 
     
           templateUrl: "views/self-service.html" 
     
          } 
     
          } 
     
         }) 
     
         .state("edirectory", { 
     
          url: "/edirectory", 
     
          templateUrl: "views/edirectory.html", 
     
          controller: 'edirectoryController', 
     
          controllerAs: 'edirectoryCtrl', 
     
          resolve: { 
     
          employeeList: function (edirectoryService) { 
     
           return edirectoryService.getAllEmployees(); 
     
          } 
     
          } 
     
         }) 
     
         .state("myLeave", { 
     
          url: "/my-leave", 
     
          templateUrl: "views/my-leave.html" 
     
         }) 
     
         .state("attendence", { 
     
          url: "/attendence", 
     
          templateUrl: "views/attendence.html" 
     
         }) 
     
         .state("compOffRequest", { 
     
          url: "/comp-off-request", 
     
          templateUrl: "views/comp-off-request.html" 
     
         }) 
     
         .state("raiseQuery", { 
     
          url: "/raise-query", 
     
          templateUrl: "views/raise-query.html" 
     
         }) 
     
         .state("eacademy", { 
     
          url: "/eacademy", 
     
          templateUrl: "views/eacademy.html" 
     
         }) 
     
         .state("downloads", { 
     
          url: "/downloads", 
     
          templateUrl: "views/downloads.html" 
     
         }); 
     
    
     
        });

    関連する問題