I have included my code in http://codepen.io/sajoambattu/pen/MbezNa
By default need to display the first related call plans data(first color, first memory) in all sections(apple, samsung, sony).
默认情况下,需要在所有部分(apple,samsung,sony)中显示第一个相关的呼叫计划数据(第一个颜色,第一个内存)。
Now it's working after onclick of the memory and color section which is correct for onclick function. My only requirement is to display the first related call plans data after loading the page.
现在它在点击内存和颜色部分后工作,这对于onclick功能是正确的。我唯一的要求是在加载页面后显示第一个相关的呼叫计划数据。
Example:
例:
In apple section, need to display 16gb and first color(Silver) related call plans.
在苹果部分,需要显示16gb和第一种颜色(银色)相关的通话计划。
In samsung section, need to display 32gb and first color(Gold platinum) related call plans.
在三星部分,需要显示32gb和第一种颜色(金铂)相关的通话计划。
Any help would be appreciated.
任何帮助,将不胜感激。
1 个解决方案
#1
0
Use ng-init() method and load the first element
使用ng-init()方法并加载第一个元素
<p ng-repeat="x in v | orderBy:'memory'" ng-init="loadFirstItem()" ng-click="showDataMemory(((x.memory+' ')+(x.presales_name)).split(' ').join('-').replace('(','').replace(')',''))">{{x.memory}}GB</p>
Please find useful plunker https://plnkr.co/edit/PpWrCJALovStcE4FRM33?p=preview
请找到有用的plunker https://plnkr.co/edit/PpWrCJALovStcE4FRM33?p=preview
#1
0
Use ng-init() method and load the first element
使用ng-init()方法并加载第一个元素
<p ng-repeat="x in v | orderBy:'memory'" ng-init="loadFirstItem()" ng-click="showDataMemory(((x.memory+' ')+(x.presales_name)).split(' ').join('-').replace('(','').replace(')',''))">{{x.memory}}GB</p>
Please find useful plunker https://plnkr.co/edit/PpWrCJALovStcE4FRM33?p=preview
请找到有用的plunker https://plnkr.co/edit/PpWrCJALovStcE4FRM33?p=preview