var myapp=angular.module("myApp",["ngRoute","ui.router"]); myapp.controller("FCtrl",function($scope,$state){ $scope.toSecound=function(name){ $scope.go("secound",{"name":name}); } }); myapp.controller("SCtrl",function($scope,$state,$stateParams){ $scope.toSecound=function(name){ $scope.name=$stateParams.name; } }); myapp.config(function($stateProvider, $urlRouterProvider){ $stateProvider .state("first",{ url:"/first", templateUrl:"servicing/first.html", controller:"FCtrl" }) .state("first",{ url:"/secound", templateUrl:"servicing/secound.html", controller:"SCtrl" }) }
时间: 2024-11-06 03:41:10