2017-09-03 4 views
1

私はindex.htmlで宣言したmain.cssに私のスタイルを持っていました。しかし、私は別のファイルに移動し、私のrouteProvider内のスタイルシートを宣言しようとしましたが、これはちょうど上の(これはmain.cssのスタイルになっています)ナビゲーションバーの白いページを表示しています..私のrouteProviderプロバイダは、angle routeProvider for stylesheet

.when('/', { 
    templateUrl: 'static/partials/landing.html', 
    controller: IndexController 
    css: 'static/css/home.css' 
}) 
.when('/about', { 
    templateUrl: 'static/partials/about.html', 
    controller: AboutController 
}) 
.when('/post', { 
    templateUrl: 'static/partials/post-list.html', 
    controller: PostListController 
}) 
.when('/post/:postId', { 
    templateUrl: '/static/partials/post-detail.html', 
    controller: PostDetailController 
}) 
/* Create a "/blog" route that takes the user to the same place as "/post" */ 
.when('/blog', { 
    templateUrl: 'static/partials/post-list.html', 
    controller: PostListController 
}) 
.otherwise({ 
    redirectTo: '/' 
}); 

これは私の初めてのアングルでは本当に遊んでいるので、私は単純なものが欠けているかもしれないと思った。私はしばらくの間ウェブを検索したが、あまり出てこなかった。

+0

ここに[こちら](https://stackoverflow.com/questions/15193492/how-to-include-view-partial-specific-styling-in-angularjs)に関する質問がありますか? –

答えて

1

あなただけの代わりにあなたがangular-css

var myApp = angular.module('myApp', ['ngRoute', 'angularCSS']); 

を使用して、構成内の個々のCSSを提供することができ、ライブラリまたはコンパイルする指示なしにrouterProviderでCSSを含めることはできません。

+0

これは助けになりました。リンクありがとう。 –

関連する問題