AngularJS ng-selected
ညွှန်ကြားချက်
ဥပမာ
selected
ရည်ညွှန်းချက်ကို အမှန် ဟု သတ်မှတ် ပါ -
Click here to select BMW as your favorite car:
<input type="checkbox" ng-model="mySel">
<p>My Favourite car:</p>
<select>
<option>Volvo</option>
<option ng-selected="mySel">BMW</option>
<option>Ford</option>
</select>
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
ညွှန်ကြားချက် သည် ng-selected
<select> စာရင်းထဲတွင် <option> ဒြပ်စင်တစ်ခု၏ ရွေးချယ်ထားသော အရည်အချင်းကို သတ်မှတ်ပေးပါသည်။
attribute အတွင်းရှိ expression ng-selected
သည် true ပြန်သွားပါက option ကို ရွေးပါမည်။
ညွှန်ကြားချက်သည် တန်ဖိုး နှင့် အ ng-selected
ကြားသို့ ပြောင်းနိုင်စေရန် လိုအပ်သည် ။ HTML တွင်၊ သင်သည် အရည်အချင်းကို သတ်မှတ်၍မရပါ (ရွေးချယ်ထားသော ရည်ညွှန်းချက်၏ တည်ရှိမှုသည် ၎င်း၏တန်ဖိုးကို မခွဲခြားဘဲ ဒြပ်စင်အား ရွေးချယ်စေသည်)။true
false
selected
false
အထားအသို
<option ng-selected="expression"></option>
<option> ဒြပ်စင်မှပံ့ပိုးထားသည်။
ကန့်သတ်တန်ဖိုးများ
Value | Description |
---|---|
expression | An expression that will set the element's selected attribute if it returns true. |