[英]ternary operator in ng-app?
Iam working on a component in AEM. Iam在AEM中处理组件。 I have components with independent
ng-app
for each component since Iam having multiple websites in each package and using the same components across various websites. 我的每个组件都有独立的
ng-app
组件,因为Iam在每个程序包中都有多个网站,并且在各个网站中使用相同的组件。
Now when I drag and drop a component multiple times in a same page. 现在,当我在同一页面中多次拖放组件时。 Only one component is working.
只有一个组件在工作。 I sense it is coz of having same
ng-app
name. 我感觉这是因为具有相同的
ng-app
名称。 May I know how can I overcome it. 我可以知道如何克服它。 Coz., even though the component is same., based on requirement., we had to make differnt API call and get data respect to that section in view.
即使是相同的组件,根据要求,我们也必须进行不同的API调用,并获取有关该部分的数据。
Iam having an idea of using ternary operator
inside ng-app
like this 我有一个在
ng-app
中使用ternary operator
的想法
ng-app="{{ apiType ? type1 : type2 }}"
But not sure ternary operator
fires before ng-app
declaration. 但不确定
ng-app
声明之前会触发ternary operator
。
Any Ideas 有任何想法吗
Here is the sample plnkr based on inputs I received. 这是基于我收到的输入的样本plnkr。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.