0

If I update model from input field the view also update properly.

here's the code

  <div class="form-group">
   <input type="number" ng-model="optionsOfDirective.startSlide"class="form-control">
  </div>

and the model is

        $scope.optionsOfDirective = {
                startSlide: 0
            };

and the picture enter image description here But if I update the model data on mouse click through controller the model value got updated and the view also but after a second the view return to it's previous stage.enter image description here

Here's the ng-click code

<div>
   <a class="btn btn-primary btn-block" role="button" data-slide="next"
 ng-click="btnClickCounter();" ng-model="optionsOfDirective.startSlide">      Next </a>

And the model update

$scope.btnClickCounter = function () {
  $scope.optionsOfDirective.startSlide=7;
};

Why the view is not remaining same if i set value in controller.

Nazmul
  • 143
  • 14

0 Answers0