Bobi B

Bobi B

  • NA
  • 476
  • 11.6k

pls any one help to reload the page

Nov 7 2018 4:21 AM
Hello genius,
angular
.module('WFM')
.controller('ResetPasswordCtl', ResetPasswordCtl)
function ResetPasswordCtl($scope,$location,$templateCache,$window,wfmFactData,toaster){
$templateCache.removeAll();
$scope.new_pwd = "";
$scope.conf_pwd = "";
Load_ResetPwd();
function Load_ResetPwd() {
debugger;
var refcode = $location.search()['EmpCode'];
if (refcode != undefined) {
if ($location.path() == "/ResetPwd") {
var emp_code = $location.search()['EmpCode'];
var url = 'wfm/getLoginInfo_Mail?emp_guid=' + emp_code;
wfmFactData.getServiceData(url)
.success(function (data) {
if (data.ErrorMessage == null) {
$window.sessionStorage.session_userInfo = JSON.stringify(data);
$scope.IsErrorMessage = "false";
$window.sessionStorage["IsReset"] ="RESET";
$location.path("/ResetPwd");
$location.search('EmpCode', null);
} else {
$scope.ErrorMessage = data.ErrorMessage;
$scope.IsErrorMessage = "true";
}
})
.error(function (error) {
var status = 'Unable to load Service data: ' + error.message;
console.log(status);
});
}
else {
$scope.image_url = "images/user.png";
$scope.user_name = "";
$scope.email = "";
$scope.lastlogin = "";
// $location.path("/");
}
}
$location.path("/ResetPwd");
}
}
 
above is my code , once i open the page,the page not displaying the data, but when i refresh its displaying, i dont donna how to reload the page pls any one help
 

Answers (1)