Sam Palmer Sam Palmer - 1 year ago 71
AngularJS Question

Angular JS UI-Router Example not working

I'm new to JS, and am trying out a simple Angular ui-router example, but I can't seem to get the router working, and can't see why. I've tested a few examples to make sure angular has been loaded and custom.js has been loaded (which they are), but when I come to using the router I get nothing, from my little knowledge I can't see anything glaringly obvious (this is basically and copy and paste example).


<!DOCTYPE html>
<html ng-app = "routerApp">
<script src="js/angularmin.js"></script>
<script src="js/custom.js"></script>
<div ui-view></div>



var routerApp = angular.module('routerApp', ['ui.router']);

routerApp.config(function($stateProvider, $urlRouterProvider) {

// HOME STATES AND NESTED VIEWS ========================================
.state('home', {
url: '/home',
templateUrl: 'home-partial.html'

// ABOUT PAGE AND MULTIPLE NAMED VIEWS =================================
.state('about', {
// we'll get to this in a bit


Answer Source

You have not referenced the js file for ui-router,

    <script src="js/angularmin.js"></script>
    <script src="" > </script>
    <script src="js/custom.js"></script>