AngularJS – 基本介紹篇

看完上一篇有關AngularJS的文章之後,如果你已經產生對他的興趣,接下來我們就跟著Google規劃的課程來學習,其實在AngularJS的官方網頁上,本來就有這方面的視訊教學(當然是英文的囉!),馬老師這邊只是做到整理、翻譯和提出我的一些想法,讓想要學習他的人可以更方便,官方視訊總共分成五個等級,每個等級又分成不同章節,章節結束後還都會有模擬測驗,真的推薦大家可以去看看喔!

首先檢視一下要學習AngularJS的一些背景條件:

必須要了解

  • HTML、CSS
  • Javascript

最好能懂

不是那麼重要的

  • jQuery
  • Ruby
  • Rails
  • Python
  • PHP
  • Database

必須了解的部分指的是技術領域,最好能懂的部分是指開發時的觀念

AngularJS Part1 Slide1

至於選擇AngularJS的理由有以下幾點:

  • 幫助你組織Javascript
  • 快速幫你建構動態網站
  • 可以跟jQuery合作愉快
  • 便於測試
AngularJS Part1 Slide2

接下來官方教學以ng-controller為案例,教導AngularJS是如何去呼叫函數的,不過這部分在1.3以上的版本已經不是這樣使用了要特別注意!

AngularJS Part1 Slide3

以下就針對這個案例進行程式的示範,在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)。

AngularJS Part1 Slide4

上述的程式可以撰寫在一個JS檔案中,讓網頁將該檔案引用。

AngularJS Part1 Slide5

接下來在HTML標籤中加入ng-app=”Application Name”後,讓網頁在載入的時候就會自動運行該模組(Module)。

AngularJS Part1 Slide6

接下來開始介紹表達式,不過這個在上一篇案例當中我們已經有使用過了,相信大家也很容易能夠了解,也建議大家去參考視訊中提到的網頁,裡面有更多有關於表達式的說明。

AngularJS Part1 Slide7

※以上截圖部分為AngularJS官方教學視訊

You may also like...

14,522 Responses

  1. Если вы искали где отремонтировать сломаную технику, обратите внимание – ремонт бытовой техники

  2. Great site! I recommend it to everyone!anal training kit

  3. Если вы искали где отремонтировать сломаную технику, обратите внимание – профи барнаул

  4. Top rated lad speeches and toasts, as well toasts. may very well be supplied taken into consideration making at the party consequently required to be a little more cheeky, humorous with instructive on top of this. best man speeches funny

  5. The 9 Things Your Parents Taught You About Mesothelioma Claim
    mesothelioma Claim (balle-ibrahim-4.federatedjournals.com)

  6. Jessewrify表示:

    The Cruciality of Vibrations Regulation Systems in Machines
    In industrial settings, machines and rotational devices serve as the backbone of manufacturing. However, an of the most widespread issues which can hinder the functionality and lifetime exists as vibrations. Resonance can lead to a array of complications, such as minimized accuracy and efficiency to greater wear and tear, finally causing costly downtime along with restoration. Such a situation is when resonance control tools becomes critical.

    Why Vibration Management is Necessary

    Vibration within machinery might lead to various harmful outcomes:

    Lowered Operational Performance: Excessive vibrations might cause discrepancies as well as unbalance, minimizing the efficiency of the equipment. This may bring about slower production times and increased energy use.

    Greater Deterioration: Persistent vibrations accelerates overall erosion in machinery parts, causing increased maintenance and the potential of unexpected unexpected breakdowns. This not only increases production expenses but also reduces the longevity in the existing equipment.

    Security Risks: Uncontrolled vibrations might pose considerable dangers to both the equipment and the equipment and the operators. In severe cases, serious conditions, these may result in devastating equipment failure, threatening workers along with bringing about significant harm to the premises.

    Exactness as well as Manufacturing Quality Issues: For industries that demand high accuracy, including industrial sectors and aviation, vibrations could bring about inaccuracies with the manufacturing process, causing faulty goods and increased waste.

    Economical Options for Vibration Management

    Putting money into resonance control tools is not just a necessity and also a wise choice for any business that relies on machines. Our state-of-the-art vibration mitigation tools are designed to mitigate vibrations in various equipment or rotating machinery, ensuring smooth and effective performance.

    One thing that sets our systems apart is its its economic value. It is recognized that the significance of keeping costs low within the current market, and for that reason our offerings include high-quality oscillation control tools at prices that are affordable.

    Through selecting our equipment, you’re not only preserving your equipment and boosting its efficiency but also putting resources in the sustained achievement of your operations.

    Conclusion

    Vibration control proves to be a vital component in preserving the effectiveness, safety, and lifespan of your industrial equipment. With our affordable vibration control equipment, it is possible to be certain your operations function efficiently, your products maintain top quality, and all personnel stay secure. Do not let resonance affect your operations—make an investment in the correct apparatus today.

  7. Jessewrify表示:

    The Cruciality of Vibrations Management Apparatus in Mechanical Systems
    Across industrial environments, machines as well as rotational systems are the core of operations. Nonetheless, one of the commonly common challenges that might impede their functionality as well as lifetime exists as resonance. Resonance could bring about an range of complications, from lowered perfection as well as productivity to increased damage, ultimately resulting in costly delays and repairs. This is where vibration regulation equipment is essential.

    Why Vibration Management remains Important

    Resonance within machines can bring about multiple harmful impacts:

    Minimized Operational Performance: Excessive vibration can cause misalignment and instability, lowering overall efficiency with the systems. This could lead to slower production times and greater energy use.

    Greater Erosion: Constant vibration speeds up overall wear and tear of machinery parts, resulting in increased repairs as well as a chance of unexpected breakdowns. Such a scenario does not just increases production expenses but also shortens the longevity of the equipment.

    Protection Risks: Excessive resonance might present considerable safety concerns both to both the equipment along with the operators. In severe cases, severe cases, these can bring about catastrophic equipment failure, endangering personnel and resulting in extensive devastation in the premises.

    Exactness as well as Quality Concerns: Within fields where depend on exact measurements, such as manufacturing or aerospace, vibration can cause discrepancies in the manufacturing process, resulting in faulty goods and more waste.

    Reasonably Priced Alternatives for Vibration Control

    Investing in oscillation control tools is not only a necessity and also a smart decision for any organization involved with equipment. The offered modern vibration mitigation tools are designed to remove resonance from all equipment and rotating equipment, ensuring smooth and effective performance.

    Something that differentiates such equipment apart remains its economic value. We understand the importance of cost-effectiveness in the competitive market of today, thus we offer top-tier vibration control solutions at rates that won’t break the bank.

    Through selecting our offerings, you’re not only securing your machines along with boosting its operational effectiveness but also putting investment into the enduring success of your operations.

    In Conclusion

    Vibration control is a vital element of maintaining the efficiency, protection, as well as lifespan of your industrial equipment. Using our economical oscillation control systems, you can ensure your production run smoothly, your products maintain top quality, along with your employees stay safe. Don’t allow resonance affect your machinery—put money in the correct apparatus now.

  8. Jessewrify表示:

    The Importance of Vibrations Control Systems in Machinery
    Inside industrial sites, machines and rotational machinery constitute the foundation of manufacturing. Nonetheless, one of the highly frequent issues which could affect the performance as well as lifetime is vibrations. Vibrations might result in a range of problems, such as reduced perfection and performance resulting in elevated erosion, in the end causing pricey delays and fixes. Such a situation is when resonance control tools becomes essential.

    Why Vibrations Mitigation proves Important

    Oscillation inside industrial equipment can cause multiple harmful consequences:

    Minimized Production Performance: Excessive resonance may bring about imbalances and distortion, lowering total efficiency in such equipment. Such a scenario might bring about reduced production times and increased energy use.

    Increased Wear and Tear: Persistent oscillation hastens the erosion to machinery parts, leading to more regular maintenance as well as the possibility of unexpected issues. This does not just elevates maintenance expenses but also limits the longevity of the existing machinery.

    Safety Hazards: Unmanaged oscillation might bring significant safety concerns to both the machinery along with the operators. In extreme situations, severe cases, such vibrations may lead to cataclysmic equipment failure, endangering employees along with causing extensive devastation in the site.

    Precision as well as Quality Issues: Within businesses which depend on precise production, such as manufacturing as well as aerospace, vibration can cause flaws during the manufacturing process, leading to defective products along with increased waste.

    Affordable Approaches for Vibration Regulation

    Investing in resonance control equipment remains not just a necessity and a smart decision for all businesses that any industry involved with mechanical systems. We offer modern vibration mitigation tools are engineered to reduce oscillation in any mechanical systems as well as rotating machinery, ensuring smooth as well as productive processes.

    Something that sets our systems from others is its economic value. We know the importance of keeping costs low within the current market, which is why we offer top-tier vibration management solutions at pricing that won’t break the bank.

    Through selecting our equipment, you’re not only safeguarding your mechanical systems and improving its operational effectiveness as well as putting investment in the long-term success of your company.

    In Conclusion

    Vibration control proves to be an essential aspect of maintaining the operational performance, safety, along with lifetime of your industrial equipment. Using our affordable resonance mitigation apparatus, you can ensure your processes operate seamlessly, your products maintain high quality, and all personnel are protected. Don’t allow oscillation compromise your business—invest in the correct apparatus today.

  9. Lost Car Keys What To Do Tips To Relax Your Daily Life Lost Car Keys What To Do Technique Every Person Needs To Know lost car keys what to do

  10. I am no longer positive the place you’re getting your info, but great topic. I must spend a while learning much more or working out more. Thanks for fantastic info I used to be in search of this info for my mission.

  11. Jessewrify表示:

    vibration analysis
    The Importance of Vibrations Mitigation Systems in Industrial Equipment
    Across production environments, machinery and spinning machinery constitute the support of manufacturing. However, a of the commonly prevalent concerns which might affect its efficiency and lifetime remains resonance. Oscillation can lead to an array of problems, from minimized perfection along with efficiency to greater wear and tear, finally leading to high-cost downtime and repairs. This scenario is why vibration regulation apparatus is critical.

    Why Vibration Control is Important

    Resonance inside equipment might cause various harmful consequences:

    Lowered Production Performance: Excess resonance could result in misalignment and instability, decreasing the efficiency of the equipment. This can lead to delayed production schedules and elevated electricity usage.

    Greater Erosion: Constant vibration increases overall damage to mechanical parts, leading to more frequent repairs and the risk for unanticipated unexpected issues. This does not just elevates operational costs as well as reduces the durability of the systems.

    Safety Risks: Unchecked vibrations can bring substantial safety concerns to both the machines along with the personnel. In, severe cases, this could lead to cataclysmic system collapse, jeopardizing employees and causing significant harm in the facility.

    Exactness and Quality Issues: For fields which rely on high accuracy, including production and space industry, vibrations may result in inaccuracies in production, producing defects and more waste.

    Affordable Options for Vibration Regulation

    Investing in vibration control equipment remains not merely a necessity but a smart decision for any company that relies on machines. Our modern vibration management systems are built to eliminate vibrations from various machinery or rotational systems, providing uninterrupted and effective performance.

    What differentiates such systems above the rest remains its economic value. We know the value of keeping costs low within today’s competitive market, thus we have high-quality vibration regulation systems at prices that are affordable.

    By choosing our offerings, you’re not only protecting your equipment along with increasing its performance as well as investing in the enduring achievement of your business.

    Final Thoughts

    Oscillation control proves to be an essential element in ensuring the operational performance, safety, as well as longevity of your equipment. With our economical resonance mitigation apparatus, one can ensure that your production run smoothly, all manufactured items maintain top quality, and all personnel stay secure. Don’t permit vibration compromise your operations—invest in the correct apparatus immediately.

  12. I must admit that this is one great insight. It surely gives a company the opportunity to get in on the ground floor and really take part in creating something special and tailored to their needs.

  13. Pegsma表示:

    pyridostigmine order online – buy mestinon 60mg for sale order azathioprine 50mg

  14. Your writing is so eloquent and polished. It’s clear that you’re a true master of your craft.

  15. When I originally commented I clicked the -Notify me when new comments are added- checkbox and already each time a comment is added I get four emails with similar comment. Perhaps there is that is you are able to remove me from that service? Thanks!

  16. It’s The Good And Bad About Lost Car Keys Replacement Cheap Car keys replacement

  17. What Is Kids Triple Bunk Beds? How To Utilize It bunk Beds for kids

  18. Если вы искали где отремонтировать сломаную технику, обратите внимание – профи тех сервис челябинск

  19. Если вы искали где отремонтировать сломаную технику, обратите внимание – техпрофи

  20. Chastity表示:

    Solutions To Issues With Montpellier Retro Fridge Freezer retro fridge freezer sale uk (Chastity)

  21. Если вы искали где отремонтировать сломаную технику, обратите внимание – выездной ремонт бытовой техники в барнауле

  22. Если вы искали где отремонтировать сломаную технику, обратите внимание – ремонт цифровой техники барнаул

  23. Great site! I recommend it to everyone!big dildos

  24. Find all that is about News with our valuble article.

  25. I do not even know how I ended up here, but I thought this post was good. I don’t know who you are but definitely you’re going to a famous blogger if you aren’t already Cheers!

  26. some jewelry stores offer a good deal of bargain for their new jewelry styles*

  27. Perfect work you have done, this web site is really cool with great information.

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。