javascript - $window.location is not working in ipad only with angular js -
**my angular function **
self.login = function () { loginservice.login(self.user).success(function (response) { sessionservice.set("token", response.response.token); $window.location.href = "/camera"; }).error(function (response) { flashservice.showerror(response.message); }); }
my html code
<form name="myform" class="row" ng-submit = loginctrl.login() novalidate> <label>username or email</label> <div class='form-group' ng-class="{ 'has-error' : myform.username.$invalid && !myform.username.$pristine }"> <input type="text" name="username" class="input-block-level form-control" placeholder="your username or email" ng-model = "loginctrl.user.email" required/> <p ng-show="myform.username.$invalid && !myform.username.$pristine" class="help-block">please enter username or email.</p> </div> <label >password <a class="password" href="javascript:void(0)" data-toggle="modal" ng-click="loginctrl.openforgetpasswordmodal('md')" >forgot it?</a></label> <div class='form-group' ng-class="{ 'has-error' : myform.password.$invalid && !myform.password.$pristine }"> <input type="password" name= "password" class="input-block-level form-control margin-none" placeholder="your password" ng-model = "loginctrl.user.password" required/> <p ng-show="myform.password.$invalid && !myform.password.$pristine" class="help-block">please fill password.</p> </div> <div class="separator bottom"></div> <div class="col-md-8 padding-none "> <div class="uniformjs"><label class="checkbox theme-color"><input type="checkbox" value="remember-me" ng-model = "loginctrl.remember" ng-click="loginctrl.rememberme()"remember-me>remember me</label> </div> </div> <div class="col-md-4 pull-right padding-none"> <button class="btn btn-block btn-primary" type="submit">sign in</button> </div> </form>
i want when click on login button redirect on seprate page.but window location not working here.
use this:
$location.path('/camera');
Comments
Post a Comment