Chcę uzyskać dostęp do localhost: 3000/admin, który jest w moich poglądach .. the index.html i admin.html są moje dwa różne pliki bazowe jeden dla użytkowników i druga jest dla administratora desce rozdzielczej odpowiednioJak korzystać z wielu stron indeksu w kanciastych
w moich app.routes.js mam ten
angular.module('appRoutes', ['ngRoute'])
.config(function($routeProvider, $locationProvider) {
$routeProvider
.when('/', {
templateUrl: 'app/views/pages/home.html',
controller: 'MainController',
controllerAs: 'main'
})
.when('/admin', {
templateUrl: 'app/views/admin.html',
})
.when('/logout', {
templateUrl: 'app/views/pages/home.html'
})
.when('/login', {
templateUrl: 'app/views/pages/login.html'
})
.when('/signup', {
templateUrl: 'app/views/pages/signup.html'
})
.when('/admin/login' ,{
templateUrl: 'app/views/pages/adminlogin.html'
})
$locationProvider.html5Mode(true);
})
w server.js mam ten
app.get('*', function(req, res){
res.sendFile(__dirname + '/public/app/views/index.html');
});
istnieją dwa pliki indeksu html: indeks. h tml, admin.html chcę otworzyć admin.html gdy adres URL jest: localhost: 3000/admin
i index.html gdy adres URL jest: localhost: 3000
screenshot of the app structure
w widokach/pages Mam wszystkie strony html wymagane przez index.html i admin.html przy użyciu ng-view
Proszę podać co pytasz o, jak obecnie nie jest jasne, co jest problemem. –
Możliwe wskazówki dla Ciebie: http://stackoverflow.com/questions/24927784/angularjs-ui-router-multiple-pages –
http://stackoverflow.com/questions/16906231/multiple-index-html-pages-angular –