angular-ui-router
  • Introduction
  • Configuring State
  • Activating State
  • Named Views
  • Nested State
  • onEnter onExit
  • Passing Data
  • Resolve Property
  • State Params
  • State Service
  • State Events
  • Abstract State
Powered by GitBook
On this page
  • Setup
  • ui-view - where to place your template

Was this helpful?

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>
NextConfiguring State

Last updated 5 years ago

Was this helpful?