ionic framework - How to conditionally set selected property in AngularJS -


मेरे पास एक ऐसा फ़ील्ड है:

  & lt; ng-init = "एक्सचेंज ओपन = विजेट.content.exchange [0]" एनजी-मॉडल = "एक्सचेंज ऑप्शन" एनजी-ऑप्शंस = "एक्सचेंज ऑप्शन। टाइटली एक्सचेंज के लिए ओपन में विजेट। कॉन्टेंट। एक्सचेंज" एनजी-चेंज = "आंतरिक लिंक्स (एक्सचेंज ऑप्शन। यूआरएल)" & gt; & Lt; / चयन & gt;  

जैसा कि आप देखते हैं, अभी मैं हमेशा पहला विकल्प चुनता हूं लेकिन वास्तव में "एक्सचेंजों" में "चयनित" फ़ील्ड है, जो एक बूलियन है, जो सही पर सेट होता है यदि वह विकल्प चयनित होना चाहिए।

आप ऐसा कैसे करेंगे?

अग्रिम धन्यवाद!

आप एक्सचेंजों को छानने के द्वारा चयनित विनिमय विकल्प को वापस करने के लिए एक विधि लिख सकते हैं। / P>

  & lt; चुनें ng-init = "exchangeOption = getSelectedExchange ()" एनजी-मॉडल = "एक्सचेंजऑप्शन" एनजी-विकल्प = "एक्सचेंज ऑप्शन डॉइटली एक्सचेंज ओपन चेंज" widget.content.exchange "एनजी-परिवर्तन = "आंतरिक लिंक्च (एक्सचेंज ऑप्शन.रिल)" & gt; & Lt; / चयन & gt;  

Comments

Popular posts from this blog

HTML/CSS - Automatically set height width from background image? -

php - Mysql Show Process - Sleep Commands and what to do -

c - What is the address of buf (the local variable in the main function)? -