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官方教學視訊。
What To Look For In The ADHD Test In Adults To Be Right For You where can i get tested for adhd
This Is The Ultimate Cheat Sheet On Land Rover Spare Key land rover
active key – Keri,
7 Tips About Honda Replacement Key That Nobody Will Share With You cost
Considerably, the particular post is really the very best on this deserving subject. To be sure together with your findings as well as may excitedly look forward to Your potential updates. Just stating many thanks definitely will not only you need to be enough, for your great clarity within your writing. I will straight away get Your own rss to keep up-to-date with any type of updates. Genuine perform and also significantly good results in your company dealings!
The 9 Things Your Parents Teach You About Replace Mazda Key mazda key
Why You Must Experience Lexus Key Maker At The Very Least
Once In Your Lifetime lexus key fob replacement
16 Must-Follow Instagram Pages For Test For Adult ADHD-Related Businesses test For adhd adults
7 Secrets About Ghost 2 Immobiliser Cost That Nobody Can Tell You ghost 2 Immobiliser Reviews
A List Of Common Errors That People Do With Treating Adult ADHD alternative adhd treatment for
Adults – https://520yuanyuan.cn,
In accordance with my study, after a the foreclosure home is bought at a bidding, it is common for any borrower in order to still have some sort ofthat remaining balance on the mortgage. There are many loan merchants who make an effort to have all expenses and liens paid back by the following buyer. Even so, depending on specified programs, laws, and state laws and regulations there may be many loans which aren’t easily handled through the exchange of loans. Therefore, the responsibility still lies on the lender that has had his or her property in foreclosure process. Many thanks sharing your thinking on this weblog.
Ten Things You Need To Be Aware Of Nissan Spare Key nissan armada key Replacement
This Is The Ultimate Cheat Sheet For Mesothelioma Legal Mesothelioma claim
It’s the best time to make some plans for the future and it is time to be happy. I have read this post and if I could I desire to suggest you few interesting things or advice. Maybe you could write next articles referring to this article. I want to read more things about it!
Your Family Will Thank You For Getting This Audi Key Fobs
Audi A3 Key Fob Replacement
Howdy! Do you know if they make any plugins to safeguard against hackers? I’m kinda paranoid about losing everything I’ve worked hard on. Any recommendations?
Pretty! This was a really wonderful article. Thanks for providing this information.
10 Instagram Accounts On Pinterest To Follow About Hyundai Keys
car key Replacement hyundai
15 Great Documentaries About Anxiety Disorder medication for social anxiety Disorder, icecreamge9.Creamcon.kr,
What Mercedes Car Key Experts Want You To Be Educated Mercedes key programing
5 Killer Quora Answers To ADHD Medications For Adults Adhd Medications For Adults
You’ll Be Unable To Guess Bagless Smart Sweepers’s Tricks Bagless Smart Sweepers
5 Laws Everyone Working In Railroad Injuries Law Should Be Aware Of champaign Railroad crossing accident Attorney
17 Signs You Work With Volvo Replacement Key Volvo S40 Replacement Key Cost (Openlabware.Org)
What NOT To Do Within The Robot Vacuum For Carpet
Industry best robot Vacuum And mop Reviews
How To Solve Issues Related To Coffee Beans organic coffee beans
With havin so much content and articles do you ever run into any issues of plagorism or copyright violation? My website has a lot of exclusive content I’ve either authored myself or outsourced but it appears a lot of it is popping it up all over the web without my permission. Do you know any solutions to help stop content from being stolen? I’d certainly appreciate it.
20 Trailblazers Lead The Way In Treadmill Desk Uk folding
treadmill desk – Clara,
Locksmith Near Me For Cars Tools To Make Your Daily Life Locksmith Near Me For Cars
Trick Every Person Should Know near
20 Resources That Will Make You Better At Shark Robot Vacuum Best Vacuum Cleaner And Mop Robot
The Most Common Mistakes People Make When Using Car Lock.Smith elsy
crays (gorillainvestment.com)