javascript - scope value not assigning during ionicView.loaded event -


i trying assign value input type controller. precisely,i trying during ionicview.loaded event , before hiding splashscreen manually.

here, not working , value user.ph_no not getting assigned.

also check, put button click event , assigning value user.ph_no inside it.

it working.

what missing value assigned during ionicview.loaded event?

below controller button click event , ionicview onload event.

angular.module('app.controllers', ['ionic'])  .controller('registerctrl', function($scope) {     $scope.user = {};     $scope.$on('$ionicview.loaded', function() {         ionic.platform.ready( function() {             if(navigator && navigator.splashscreen){                 $scope.user.ph_no = "12344434";                 navigator.splashscreen.hide();             }          });     });      //button click event     $scope.register = function() {     //$scope.user.ph_no = window.mainactivity.getphn_number();     $scope.user.ph_no = "9959";     }; }) 

assign value input:

<input type="text" ng-model="user.ph_no" name="ph_no"  />  .controller('registerctrl', function($scope) {     $scope.user = {       ph_no:'12344434'     } }) 

Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -