How to access isolated scope variables from angular components

137 views Asked by At

Considering this situation, where i am relying on fileupload component which is been used in 3 places in the same form distinguished with value binded.

A Total of 3 components in use distinguished with one variable binded

In that particular isolated controller. There are value being set.

How can i fetch those values independently w.r.to that particular scope?

Example:

<test-component type="abc"></test-component>

Component consists of one input field

<input type="text" ng-model="vm.input" />

Inside controller

  vm.type = this.type // abc

  vm.input from 1st component will be suppose: 'foo'
  vm.input from 2nd component will be suppose: 'boo'
  vm.input from 3rd component will be suppose: 'goo'

Now the requirement is need to form validate if all vm.input is entered. So, how can i fetch those individually and test it?

constraint is vm.input already has function binding. Could not change its names

0

There are 0 answers