2017-09-29 11 views
-2

こんにちは、私は実際に複数のファイルとその中のフォルダを含むフォルダをルーティングする必要があります。ルーティングするフォルダが必要です。そのフォルダ内のすべてのファイルを利用できるようにする必要があります。

For example 
My folder name is Contains -- with inner folder sample1 sample2. 
sample1 folder contains -- app.js index.js Index.html 
sample2 folder contains -- app.js index.js Index.html 

so I want routes for like every file in each folder's 
example -- localhost:3030/Contains/sample1/Index.html 
localhost:3030/Contains/sample2/Index.html 
localhost:3030/Contains/sample1/index.js 
localhost:3030/Contains/sample1/app.js 
... etc 

どのように私はstateProviderを使用してこれを達成できますか?私はここにあなたの質問を理解したよう事前

+0

uはJSファイルのルートをしたいですか、なぜを使用していますか? HTMLの場合、 'templateURL'に直接パスを提供することができます – Rahul

+0

私は実際にScormコースフォルダを持っています。その原因に関連するすべてのコンテンツをロードします。そのフォルダ内のすべてのファイルをルーティングする必要があります。 –

答えて

0

おかげで私は三重のレベルのネスト

var app = angular.module("Appp", ['ui.router']); 
    app.config(function($stateProvider, $urlRouterProvider) { 
     $stateProvider 
      .state('userSetting', { 
       url: '/userSetting', 
       templateUrl: 'templates/userSetting.html' 
      }) 
      .state('settings.profile.user', { 
       url: '/profile', 
       templateUrl: 'templates/profile.html', 
       controller: 'ProController' 
      }) 
      .state('settings.account.user', { 
       url: '/account', 
       templateUrl: 'templates/account.html', 
       controller: 'AccController' 
      }); 
     $urlRouterProvider.otherwise('/userSetting/profile'); 
    }); 
+0

トリプルレベルネストは問題ありませんが、その場合は複数のルートを宣言する必要があります。原因フォルダには実際に40個以上のファイルが含まれています –

関連する問題