我在我的应用程序和成功网址中集成了payUmoney,当我提供我的本地网址http://localhost:3000/#!/payment时,那时它没有工作,当我刷新网址时它工作得很好。问题是什么在那背后?
答案 0 :(得分:0)
尝试: app.controller('testController',[“$ scope”,“$ state”,function($ scope,$ state){
$scope.payment = function () {
//payment check here
$state.go('payment'); //redirect to payment page with payment name of state in route
}
}]);
路线
$stateProvider
.state('payment', {
url: "/home",
templateUrl: "/app/views/home/payment.html",
controller: "homeController"
})
答案 1 :(得分:0)
在angularJS中使用路由
var app = angular.module("appName", ['ngRoute']);
app.config(function($routeProvider) {
$routeProvider
.when('/view1', {
templateUrl: 'view1.html',
controller: 'FirstController'
})
.when('/view2', {
templateUrl: 'view2.html',
controller: 'SecondController'
})
.otherwise({
redirectTo: '/view1'
});
});
在此处查看正在运行的演示AngularJS routing