AngularJS – 基本介紹篇
看完上一篇有關AngularJS的文章之後,如果你已經產生對他的興趣,接下來我們就跟著Google規劃的課程來學習,其實在AngularJS的官方網頁上,本來就有這方面的視訊教學(當然是英文的囉!),馬老師這邊只是做到整理、翻譯和提出我的一些想法,讓想要學習他的人可以更方便,官方視訊總共分成五個等級,每個等級又分成不同章節,章節結束後還都會有模擬測驗,真的推薦大家可以去看看喔!
首先檢視一下要學習AngularJS的一些背景條件:
必須了解的部分指的是技術領域,最好能懂的部分是指開發時的觀念
至於選擇AngularJS的理由有以下幾點:
- 幫助你組織Javascript
- 快速幫你建構動態網站
- 可以跟jQuery合作愉快
- 便於測試
接下來官方教學以ng-controller為案例,教導AngularJS是如何去呼叫函數的,不過這部分在1.3以上的版本已經不是這樣使用了要特別注意!
以下就針對這個案例進行程式的示範,在1.2(含)以前的AngularJS可以這樣來操作ng-controller:(在JS Bin上測試)
<!doctype html> <html ng-app> <head> <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script> <meta charset="UTF-8"> <title>controllerExample</title> <script> function myFn() { alert("歡迎光臨馬老師雲端研究室"); } </script> </head> <body ng-controller="myFn"> </body> </html> 但在1.3(含)之後的AngularJS需要這樣來操作ng-controller:(在JS Bin上測試) <!doctype html> <html ng-app="controllerExample"> <head> <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js"></script> <meta charset="UTF-8"> <title>controllerExample AngularJS 1.3.2</title> <script> angular.module('controllerExample', []) .controller('myFn', function (){ alert("歡迎光臨馬老師雲端研究室"); }); </script> </head> <body ng-controller="myFn"> </body> </html>
根據上面的案例,來介紹利用AngularJS開發網頁時的流程和方式:
首先我們可以先建立一個模組(Module),在模組內會包含AngularJS的函式名稱、應用程式名稱(Application Name)和相關函式庫(Dependencies)。
上述的程式可以撰寫在一個JS檔案中,讓網頁將該檔案引用。
接下來在HTML標籤中加入ng-app=”Application Name”後,讓網頁在載入的時候就會自動運行該模組(Module)。
接下來開始介紹表達式,不過這個在上一篇案例當中我們已經有使用過了,相信大家也很容易能夠了解,也建議大家去參考視訊中提到的網頁,裡面有更多有關於表達式的說明。
※以上截圖部分為AngularJS官方教學視訊。
For example, you’ll be able to simply construct a concrete cinder block bench with easy development materials in your outdoor places.
A Handbook For Bandar Online Togel From Beginning To End togel resmi indonesia
click here to find out more
You Will Meet Your Fellow Vibrating Panties Sex
Toys Enthusiasts. Steve Jobs Of The Vibrating Panties Sex Toys Industry Vibrating Panties In Public
Thanks for your helpful article. Other thing is that mesothelioma cancer is generally brought on by the breathing of fibres from mesothelioma, which is a positivelly dangerous material. Its commonly noticed among employees in the structure industry with long experience of asbestos. It can be caused by living in asbestos protected buildings for a long period of time, Inherited genes plays a huge role, and some people are more vulnerable on the risk as compared to others.
The mantras are given freely with every pearl.
If the adjoining room is scheduled for a fix-up at a later date, consider it in your preliminary plans when selecting paint or fabric.
They are all over the center of town with nary a couple of blocks between them, so that you could at all times discover a shaded spot to name your personal.
The 10 Most Scariest Things About Upvc Window Handle Replacement window Handle Replacement
How To Create An Awesome Instagram Video About Free
Standing Corner Electric Fireplace Free Standing Electric Fires Small (Srv29897.Ht-Test.Ru)
https://ask.mallaky.com/?qa=user/ko66vip
Fridge Freezer With Water Dispenser 50 50 Tips That Can Change Your Life
fridge freezers with water dispensers (https://telegra.ph/The-People-Nearest-To-Hotpoint-Fridge-Freezer-With-Water-Dispenser-Tell-You-Some-Big-Secrets-05-29)
He provided some beneficial perception in what you need in a defensive gun.
Because of the extensive number of construction geometry, composition, and structure, specialized corporations are sometimes required to engineer construction-particular cathodic protection systems.
15 Funny People Who Are Secretly Working In Kids Bunk Bed kids bunk Beds
https://www.metooo.io/u/ko66vip
5 Laws That Anyone Working In Auto Locksmiths Should Be
Aware Of auto locksmith mobile
5 Reasons To Consider Being An Online Wild Harvested Arabica Coffee
Beans Buyer And 5 Reasons You Shouldn’t organic fair trade arabica coffee beans
View & evaluate Shotgun from the industry’s prime outdoor specialists, including Cabelas Official, Sportsman’s Warehouse and more.
9 Lessons Your Parents Teach You About Car Key Programmer key
Type via the choices, pull what you need from each generated mannequin, add your personal aptitude, and subsequently, finalize the summary that shows you as distinctive.
The cage was raised 25 ft above the shaft and several of the miners had been saved.
Since we’re ethical folks, the threat should be identified – this means illuminated.
7 Little Changes That Will Make An Enormous Difference
To Your Windows High Wycombe Composite Windows High Wycombe
The author’s hints recommend there’s more subtlety to Level 3, however for me it was simply the obligatory last battle, perhaps too grand a finale for a three degree WAD.
10 Healthy Replacement Fiat Key Habits fiat Key replacement near me
Heck, within the Midwest and most states with a major rural space darn near every rural dwelling has one tucked away somewhere.
The next time I learn a blog, I hope that it doesnt disappoint me as a lot as this one. I imply, I do know it was my option to learn, however I really thought youd have one thing fascinating to say. All I hear is a bunch of whining about something that you would fix when you werent too busy in search of attention.
Отличный сайт! Всем рекомендую!Детская оптика СПб
buy augmentin 1000mg generic – generic augmentin 375mg buy levothyroxine tablets