How to get the scope which is outside of the form directive

42 views
Skip to first unread message

Akshath Kumar

unread,
Jan 6, 2015, 5:02:03 AM1/6/15
to ang...@googlegroups.com
Hi,

There is one scenario where am accessing a ngModel value inside a form directive but the parent scope is not getting inside this form directive. How can i access the parent scope inside this form. The code look like below,
<html>
       <form>
      </form>

       <form sf-schema="schema" sf-form="form"> {{$scope.customVal}}</form>

</html>

In the above code sf-schema is an directive used for dynamic form building, $scope,customVal which is defined inside parent scope. While am trying to print the value of parent scope inside form directive its not getting accessed. So what is the reason behind this issue. Could anyone help me to sort out this issue.



Regards,

Akshath

Anton Trapp

unread,
Jan 7, 2015, 4:21:01 AM1/7/15
to ang...@googlegroups.com
How is your directive scope defined and do you really want to acces something out of the directive via the scope? (take a look at https://docs.angularjs.org/guide/directive - Isolating the Scope of a Directive - good explenation with examples to play with).
Reply all
Reply to author
Forward
0 new messages