var myApp = angular.module("myApp", [‘ui.router‘]); myApp.config([‘$stateProvider‘, ‘$urlRouterProvider‘,‘$locationProvider‘, function ($stateProvider, $urlRouterProvider, $locationProvider) { $urlRouterProvider.when("", "/one"); $stateProvider .state("one", { url:"/one", views: { "":{templateUrl: ‘view/one.html‘} } }) .state("two", { url:"/two", views: { "":{templateUrl: ‘view/two.html‘} } }) .state("three", { url:"/three", templateUrl: "view/three.html" }); $locationProvider.html5Mode(true); }]);
时间: 2024-11-13 06:41:34