0

I make a demo which is working fine .I will explain the demo I have one text field and button .Whatever user type on text field then after click button it show the text in pop up screen .when user write any thing on pop up screen and submit button press it display on screen

My Question that I take one model this ng-model="modaldata.passedValue" but when I take ng-model="passedValue" my functionality stop why ? I change every where is js also to passedValue instead of modaldata.passedValue Plunker http://plnkr.co/edit/PhXuubnDaYklqyoEdRtt?p=preview

here is code

  $scope.modalClick = function() {
      //alert($scope.modaldata.passedValue);
      textValue = $scope.modaldata.passedValue;
      $rootScope.$broadcast('modalSubmit', {
        modalText: $scope.modaldata.passedValue // send whatever you want
      });
            $modalInstance.dismiss('cancel');

    }
Pallavi Sharma
  • 635
  • 2
  • 16
  • 45
  • http://stackoverflow.com/questions/14049480/what-are-the-nuances-of-scope-prototypal-prototypical-inheritance-in-angularjs check this answer :) – Kalhan.Toress Sep 10 '14 at 03:52

2 Answers2

0

This link might be of help:

`http://stackoverflow.com/questions/17606936/angularjs-dot-in-ng-model`
ABOS
  • 3,723
  • 3
  • 17
  • 23
0

You need to change all occurrences of $scope.modaldata.passedValue to $scope.passedValue in the controller as well.

Steve Lang
  • 539
  • 4
  • 8