-1
我想重定向和一些數據傳遞給其他page.But不使用查詢字符串和URL沒有通過數據如何重定向和與POST方法
(function() {
var app = angular.module('PlateformApp', [])
app.controller('PlateformController', function ($scope,$window) {
//This will hide the DIV by default.
$scope.IsVisible = false;
$scope.ShowHide = function (platform) {
//If DIV is visible it will be hidden and vice versa.
$scope.IsVisible = $scope.IsVisible ? true : true;
//alert(platform);
document.getElementById("platform").value = platform;
var myEl = angular.element(document.querySelector('#plat_val'));
myEl.text(platform);
}
$scope.storeAppWindow = function()
{
//store_url = $scope.storeUrl;
test_bc_url = ""
text_sh_url = ""
platform_val = document.getElementById("platform").value;
$http.get("/user/installedapp")
.then(function(response) {
$scope.myWelcome = response.data;
});
if (platform_val == "BC")
$window.open(test_bc_url, "popup", "width=500,height=400,left=10,top=50");
else if (platform_val == "Sh")
$window.open(text_sh_url, "popup", "width=500,height=400,left=10,top=50");
}
});
})();
在這裏它會打開新的傳遞角JS數據窗口,但我想通過platform_val text_sh_url url在另一個頁面中。而且我在python中使用了flask。
它只是將數據傳遞給另一個控制器在angularjs中? –
我想將數據發送到其他頁面 – Piyush
,這意味着您需要將數據傳遞到該特定頁面的控制器,您可以使用localstorage或通過創建服務來完成該操作。 –