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官方教學視訊。
finasteride medication cheap propecia online
hydroxychloroquine 400 mg where can one get hydroxychloroquine where can i get hydroxychloroquine online hydroxychloroquine for arthritis in hands
https://paxil.tech/# paxil for bipolar
https://paxil.tech/# paxil depression
https://paxil.tech/# paxil ocd
https://deltasone.icu/# prednisone sale
minocycline 50mg ca cost actos arava 20mg generic
order catapres 0.1mg generic purchase spiriva online cheap purchase antivert generic
levitra 20mg cheap
neurontin 200 mg capsules neurontin 300 mg
https://ventolin.tech/# ventolin 2mg tab
cialis internet stromectol dosage for humans Buy Levitra In Us Without Prescription
order vardenafil 20mg online
levitra pills
buy clonidine 0.1mg online cheap ed pills that really work meclizine 25mg ca
buy wellbutrin cheap wellbutrin 15 mg
I really love this article.
order anastrozole 1 mg pill Cialis delivery order tadalafil 5mg online
https://ventolin.tech/# ventolin online
https://valtrex.icu/# buy valtrex
order valtrex online valtrex generic otc
https://ventolin.tech/# ventolin tablet 4mg
дата бою вусик джошуа 2
Just want to say what a great blog you got here!I’ve been around for quite a lot of time, but finally decided to show my appreciation of your work!
бэтмен темный рыцарь
order arimidex 1 mg generic buy clarithromycin 500mg generic cheap tadalafil
https://diflucan.life/# buy diflucan 150mg
Using a rated and recommended real money poker app or website is always important. If they appear on our shortlist it means that they've been tested for safety and security and have been audited to ensure fair play. When playing online poker, it's best to use a trusted name. The poker industry is driven by fierce competition and playing poker on a mobile app is the trend every reputable poker site must align with. The best poker sites in the UK have taken notable steps in providing UK residents with an over-the-top experience when it comes to poker apps by featuring an incredible mix of quality cash games. If you are not keen on having yet another mobile app installed on your Windows, Android or iOS device, you may access the UK poker sites directly through a mobile version. Beginners can play for fun cash or real money and skilled players have the opportunity to join private tables. Being one of the trusted poker sites for playing with real money, ReplayPoker provides deposits in the form of NetBanking, debit credit card s and pay by cash option. The withdrawals can be directly transferred into the player’s bank account. https://scabiesremedy.com/community/profile/gemmamazzeo1018/ For the players who love online slots, free spins are the best possible promotions available. You can search free spins for specific slot games or by the number of spins. Canadian players are lucky as they get to enjoy free spins from all the best online casinos in the industry. Every month, there are new casino free spins to play with. What’s on? Wintika Casino offers bonus spins to all new players: Exclusive 20 bonus spins on Quartz upon registration, No deposit bonus Use SecureDrop to anonymously share information with The Globe’s investigative team Thousands of players claim these bonuses every day and enjoy some free spins or bonus cash to test out the mobile casino they have registered with. 20 bonus spins on Fortunium on registration plus 200 Bonus spins on Book of Dead on your 1st deposit. Winnings from all spins credited as bonus funds and capped at ВЈ20. Bonus funds are separate to Cash funds & subject to wagering requirement . Only bonus funds contribute towards wagering requirement. Bonus funds must be used within 30 days, spins within 72hrs.
wellbutrin cost how to get brand name wellbutrin cheap
https://gabapentin.top/# gabapentin online