I am trying to use angular-ui-route, but, with no errors in console, the stateProvider doesn't work. I am not able to see my homepage (or any other)..
What am I missing?
my app.js:
var app = angular.module('app', ['ui.router', 'pascalprecht.translate'])
.config(['$stateProvider', '$locationProvider', '$translateProvider', '$interpolateProvider', '$urlRouterProvider',
function($stateProvider, $locationProvider, $translateProvider, $interpolateProvider, $urlRouterProvider) {
$locationProvider.html5Mode(true);
$locationProvider.hashPrefix("!");
$interpolateProvider.startSymbol('{[{');
$interpolateProvider.endSymbol('}]}');
$translateProvider.useStaticFilesLoader({
prefix: '/static/languages/',
suffix: '.json'
})
.preferredLanguage('pt-br');
$translateProvider.forceAsyncReload(true);
$urlRouterProvider.when('', '/');
$stateProvider.state('home', {
url: '/',
controller: "HomeCtrl as ctrl",
templateUrl:"/static/includes/home.html"
}).state('home.login', {
url: '/login',
templateUrl:"/static/includes/login.html"
});
}]);
Did you Try this
Instead of
I was using ng-view instead of ui-view
It should be
controller: "HomeCtrl"
instead of
Controller key would only take the name of the controller.