12
AngularJSを使用して別のページにリダイレクトする方法は?
私はajax呼び出しを使用してサービスファイルの機能を実行しています。応答が成功した場合、ページを別のURLにリダイレクトしたいと思います。現在、私は単純なjs "window.location = response ['message'];"を使用してこれを行っています。しかし、私はそれをangularjsコードで置き換える必要があります。私はスタックオーバーフローのさまざまなソリューションを調べましたが、$ locationを使用しました。しかし、私は角度を付けるのが初めてで、それを実装するのに苦労しています。 $http({ url: RootURL+'app-code/common.service.php', method: "POST", headers: {'Content-Type': 'application/x-www-form-urlencoded'}, dataType: 'json', data:data + '&method=signin' }).success(function (response) { console.log(response); if (response['code'] == '420') { $scope.message = response['message']; $scope.loginPassword = ''; } else if (response['code'] != '200'){ $scope.message = response['message']; $scope.loginPassword = ''; } else { window.location …
171
javascript
angularjs