Introduction

State - some place in ui ( may not have template url )

Setup

<script src="http://angular-ui.github.io/ui-router/release/angular-ui-router.js"></script>
angular.module("myApp", ['ui.router']);

angular.module("myApp")
    .config(function($stateProvider, $urlRouterProvider){
        $stateProvider.state('home', {
            url: "/home",
            controller: "HomeCtrl", // or "HomeCtrl as h"
            controllerAs: "h",
            templateUrl: "views/home.html"
        });
    });

ui-view - where to place your template

<ui-view></ui-view>

Last updated

Was this helpful?