บทที่ 1.2 เรียกใช้งาน Angular แบบ Directive

Directives
Directives

การเรียกใช้งาน Angular แบบ Directive จาก HTML Tag ของเราทำได้โดยการเพิ่ม Attribute ng-controller และเรียกใช้ฟังก์ชันที่เราประกาศไว้ในไฟล์ .js

index.html




. . .


app.js

function StoreController(){
alert('Welcome, Gregg!');
}

สารบัญ – Angular

กลับไปที่หน้า Index Angular เพื่อดูหัวข้ออื่นๆ ที่น่าสนใจ

Leave a Reply

อีเมลของคุณจะไม่แสดงให้คนอื่นเห็น ช่องข้อมูลจำเป็นถูกทำเครื่องหมาย *

This site uses Akismet to reduce spam. Learn how your comment data is processed.