Define state with parameters like this:
$stateProvider
.state('user', {
url: '/user',
params: {
obj: null
},
templateUrl: 'templates/user.html',
controller: 'UserCont'
})
when calling pass parameter like this:
$state.go('user',{obj: myobj});
in the controller UserCon receive parameter like:
$state.params.obj
User $state is one of the parameter in the controller defined like
function UserCon($scope, $http, $state){
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…