AngularJS ng-includeညွှန်ကြားချက်


ဥပမာ

ပြင်ပဖိုင်တစ်ခုမှ HTML ကို ထည့်သွင်းပါ-

<div ng-include="'myFile.htm'"></div>

အဓိပ္ပါယ်နှင့် အသုံးပြုမှု

ညွှန်ကြားချက် တွင် ng-includeပြင်ပဖိုင်တစ်ခုမှ HTML ပါဝင်သည်။

ပါဝင်သော အကြောင်းအရာကို သတ်မှတ်ထားသော ဒြပ်စင်၏ ကလေးမှတ်စုများအဖြစ် ထည့်သွင်းပါမည်။

ရည်ညွှန်းချက် ၏တန်ဖိုး ng-includeသည် ဖိုင်အမည်ကို ပြန်ပေးသည့် စကားရပ်တစ်ခုလည်း ဖြစ်နိုင်သည်။

မူရင်းအားဖြင့်၊ ပါဝင်သောဖိုင်သည် စာရွက်စာတမ်းကဲ့သို့ တူညီသောဒိုမိန်းပေါ်တွင် ရှိနေရပါမည်။


အထားအသို

<element ng-include="filename" onload="expression" autoscroll="expression" ></element>

ng-include ညွှန်ကြားချက်ကို အစိတ်အပိုင်းတစ်ခုအဖြစ်လည်း အသုံးပြုနိုင်သည်။

<ng-include src="filename" onload="expression" autoscroll="expression" ></ng-include>

HTML ဒြပ်စင်များအားလုံးမှပံ့ပိုးထားသည်။


ကန့်သတ်တန်ဖိုးများ

Value Description
filename A filename, written with apostrophes, or an expression which returns a filename.
onload Optional. An expression to evaluate when the included file is loaded.
autoscroll Optional. Whether or not the included section should be able to scroll into a specific view.