Is it possible to change the scope of a template variable?

18 views
Skip to first unread message

mike

unread,
Jul 25, 2016, 11:41:13 AM7/25/16
to AngularJS
I have a component that pulls data from a database and is used like this:

<data-service-view data-feed='["DB1", "79"]' #dsv='viewData'>
<br/>Survey {{dsv?.data[0]?.getName()}}
<br/>Stats: {{dsv?.data[1]?.getMetaData()?.stats | json}}
</data-service-view>

However, if I add the following:

<data-service-view data-feed='["DB1", "80"]' #dsv='viewData'>
<br/>Survey {{dsv?.data[0]?.getName()}}
<br/>Stats: {{dsv?.data[1]?.getMetaData()?.stats | json}}
</data-service-view>

I get a template parse error (ref. #dsv is defined several times)
Is it possible to achieve this without having to rename my #variable ?

This code is actually generated, so it would be 'easy' to just stick with a common naming convention and have the scope of the variable only be for it's immediate/containing template.

thanks for any help 

mike

mike

unread,
Aug 23, 2016, 3:29:54 PM8/23/16
to AngularJS
anyone with any ideas?
Reply all
Reply to author
Forward
0 new messages