patrick patrick - 4 years ago 125
Javascript Question

Angular JS ui-router not loading view

I am having trouble with my Angular JS ui-router and every question I have found on here shows a solutions I have already tried.

In my ui-view-tag my actual template is not displayed.

<body ng-app="myApp">
<div class="row">
<div class="col-md-6 col-md-offset-2">

This is my app.js

angular.module('myApp', ['ui.router'])
.config(['$stateProvider', '$urlRouterProvider',
function($stateProvider, $urlRouterProvider) {

.state('home', {
url: '/',
templateUrl: 'home.html',
controller: 'MainCtrl'


Thank you very much everybody, I would really appreciate a short feedback on that.

Answer Source

The $urlRouterProvider otherwise() accepts the url path you want to redirect to. Therefore you must change:



Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download