AngularJSビューをロードしません。角型アプリケーションをロードしているものすべてがうまくいきました。Node.jsのは、私はちょうどそのようなWebアプリケーションを開発していた
今、Node.jsを使用してすべてのアプリケーションをロードする必要があります。
まず、index.htmlをpublic /に移動して新しいファイルを作成します。
index.js(Node.jsの)私は、ブラウザのコンソールで得たNode.jsのruningて
app.use("/", express.static(path.join(__dirname, 'public')));
app.get('/', function(req, res) {
res.sendFile(path.join(__dirname + '/index.html'));
});
app.listen(3000, function() {
console.log('Example app listening on port 3000!');
});
:
GET http://localhost:3000/app/views/layouts/public.html 404 (Not Found)
これは私が私の角度ビュー
をロードする方法ですapp.config(function($urlRouterProvider, stateHelperProvider) {
$urlRouterProvider.otherwise('/');
$urlRouterProvider.when('', '/');
stateHelperProvider.state({
name: 'public',
title: 'Home',
url: '/',
controller: 'PublicCtrl',
templateUrl: '/app/views/layouts/public.html',
data: {
requireLogin: false
}
})
.state({
name: 'private',
controller: 'PrivateCtrl',
templateUrl: '/app/views/layouts/private.html',
data: {
requireLogin: true
},
children: [
{
name: 'browse',
title: 'Home',
url: '/browse',
templateUrl: '/app/views/browse/index.html',
controller: 'BrowseCtrl'
}
]
});
});
役立ちます
希望であるかのように
はまた、あなたはそれを書きました。 –私はnode.jsにindex.htmlを指示しました。残りの部分は作業を続けなければなりません。 – Pablo
node.jsを提供するようにnode.jsに指示していないと、node.jsはそれを提供しません。 –