ฝึก Angular 4:ตอนที่ 5 index.html

ทุกครั้งที่เปิดเว็บไซด์ http://localhost:4200 ไฟล์ index.html จะถูกเรียกใช้ ซึ่งมีโครงสร้างดังนี้

<!doctype html>
<html lang=”en”>
<head>
<meta charset=”utf-8">
<title>MyApp</title>
<base href=”/”><meta name=”viewport” content=”width=device-width, initial-scale=1">
<link rel=”icon” type=”image/x-icon” href=”favicon.ico”>
</head>
<body>
<app-root></app-root>
</body>
</html>

จะสังเกตเห็นว่า index.html คือหนึ่ง page view นั้นเอง

คือมี tag <html></html>,<head></head> และ <body></body>

และ <app-root></app-root> คือชื่อ selector ของ component app.module.ts นั่นเอง

)

Start Learning Front End

Written by

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade