
การเรียกใช้งาน Angular แบบ Directive จาก HTML Tag ของเราทำได้โดยการเพิ่ม Attribute ng-controller และเรียกใช้ฟังก์ชันที่เราประกาศไว้ในไฟล์ .js
index.html
. . .
app.js
function StoreController(){ alert('Welcome, Gregg!'); }
สารบัญ – Angular
กลับไปที่หน้า Index Angular เพื่อดูหัวข้ออื่นๆ ที่น่าสนใจ