An introduction to AngularJS architecture and usage, equipped with an overview of AngularJS role in solving the problems arised along the history of web development.
For further material and updates:
http://blog.avirancohen.com
Presented at SCREENS 2013 in Toronto with Nick Van Weerdenburg
Save 10% off ANY FITC event with discount code 'slideshare'
See our upcoming events at www.fitc.ca
AngularJS is a hot, hot, hot topic. Building web and mobile apps in AngularJS is an ease but there is a learning curve. In this session, you’ll learn the ins and outs of AngularJS and leave the session knowing how to build killer AngularJS apps.
The Complementarity of React and Web ComponentsAndrew Rota
On Github: http://andrewrota.github.io/complementarity-of-react-and-web-components-presentation/index.html
The component driven, performance focused approach of React is a perfect complement to the modularity and portability of native HTML Web Components. At first glance, React and Web Components might seem like two radically different solutions to the same problem. But when combined properly they complement each other to create an extremely powerful, expressive framework for developing complex web applications.
We Will learn about:
What is AngularJs?
Key Points
Core Features of AngularJS
How is it works?
AngularJs Terminologies
AngularJs directives
How we start work on AngularJs?
AngularJs Tags
How we use Yeoman?
Advantages and Disadvantages
This document provides an overview of AngularJS, including its philosophy and architecture. AngularJS aims to simplify development by providing model-view-controller frameworks and dependency injection. It advocates for declarative code for building user interfaces rather than imperative code. The document also discusses AngularJS concepts like templates, scopes, models, repeaters, filters and custom directives to build single page applications.
The document discusses web components, which include HTML templates, custom elements, shadow DOM, and HTML imports. Web components allow the creation of reusable custom elements with their own styles and DOM structure. They provide encapsulation and help avoid issues with global namespaces. While browser support is still emerging for some features, polyfills exist and frameworks like Polymer make web components accessible today. Web components represent an important evolution of the web that will improve how code is structured and shared.
AngularJS is a framework for building dynamic web applications. It uses HTML as the template language and allows you to extend HTML's syntax to express your application's components clearly and succinctly. AngularJS's data binding and dependency injection allows it to connect data and logic to the DOM and update the DOM when data changes. The core aspects of AngularJS covered in the document include directives, modules, scopes, controllers, templates and data binding. Key points are that directives attach behavior to DOM elements, modules allow partitioning of an app into logical blocks, scopes provide separation of model and view, and controllers extend scopes to handle logic and expose properties.
Material I prepared for a beginner's workshop on AngularJS. Feel free to change it for your own use. I would appreciate it if you attributed the original to me.
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점Jeado Ko
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점은 Angular 2.0에서 컴포넌트 기반 아키텍처로 변경되었다고 설명했습니다. Angular 2.0에서는 타입스크립트를 사용하며 컴포넌트, 디렉티브, 템플릿 등의 개념이 도입되었습니다. 또한 Angular 2.0
Levent-Gurses' Introduction to Web Components & PolymerErik Isaksen
This is in a developer-focused session on developing iOS apps with Web Components and Google Polymer.
Web Components usher in a new era of web development based on encapsulated and interoperable custom elements that extend HTML itself. Built atop these new standards, Polymer makes it easier and faster to create anything from a button to a complete application across desktop, mobile, and beyond.
JsViews - Next Generation jQuery TemplatesBorisMoore
Come and see the future of jQuery Templates, as it moves from Beta1 towards a V1 product. The new jQuery Templates is taking two forms: JsRender – lean and mean, for fast rendering of templates as strings, and JsViews – for powerful interactive browser apps in which Data Link and Templates work hand-in-hand. See how with declarative data linking and templating together, creating powerful data-driven UI is easy, whether using MVVM patterns or binding directly to JSON, and whatever the richness or complexity of the underlying data.
jQuery UI is already building its future data-bound widgets on top of this technology. With JsViews and JsRender integration between jQuery UI controls and your own data and UI becomes trivially straightforward.
This document provides an overview of Angular JS including its architecture, components like controllers, services, directives and views. It discusses best practices for controllers, creating services, using directives, and avoiding the Flash of Unstyled Content issue. It also mentions the UI-Router module and recommends a file structure for Angular apps. In the end, it lists some pros and cons of Angular JS, noting its two-way binding, component architecture, and rapid development but also potential performance issues with deep object graphs.
AngularJS is an MVC framework for building client-side web applications. It uses two-way data binding between models and views, dependency injection to decouple modules, and directives to extend HTML. Key features include routing for single-page applications, services for reusable logic, and tools for testing AJAX code. AngularJS provides standard directives, services, and routing capabilities to build complete applications in the browser.
AngularJS is a JavaScript framework that extends HTML with directives and binds data to HTML with expressions. Some key points:
- AngularJS extends HTML with directives like ng-app, ng-model, and ng-bind.
- Expressions written with double braces like {{expression}} output data on the HTML page.
- Modules define AngularJS applications and controllers control the application logic and data.
- Common directives include ng-init, ng-click, ng-repeat, and filters like currency and lowercase can be used.
- A shopping cart example demonstrates binding data with ng-repeat, adding items with ng-click, and removing with ng-click.
An introduction to Web Components describes why we should use web components for Web App development and how Polymer Javascript library from Google can help build web components faster.
The document outlines best practices for building applications with AngularJS. It discusses the differences between single page apps built with AngularJS and traditional apps, recommending approaches like following AngularJS style guides. The document also summarizes upcoming features for AngularJS 2.0 like improved directives and server-side rendering. Resources are provided for tools like Grunt, Bower, and techniques like search engine optimization for single page apps.
This document summarizes the history and benefits of AngularJS. It explains that AngularJS was originally created in 2009 as a side project by Misko Hevery and Adam Abrons to build a tool for both front-end and back-end development. When working on a Google project called Google Feedback, Hevery was able to rewrite 17,000 lines of code into 1,500 lines using his AngularJS framework by taking advantage of its features like separation of concerns, modularity, and reusable components. The document then lists some key benefits of AngularJS like being lightweight, free, and improving structure, quality, organization and maintainability of code.
This document provides an overview of AngularJS, including its core features and concepts. It discusses how AngularJS is a client-side JavaScript framework that uses MVC architecture. Key points covered include two-way data binding, templates, dependency injection, modules, controllers, views, models, scopes, filters, services, and directives. Custom directives and their creation are demonstrated. The document aims to give attendees an introduction to AngularJS and its basic building blocks.
RequireJS is an asynchronous script loader that addresses issues with loading multiple JavaScript files. It implements the Asynchronous Module Definition (AMD) specification to load modules and their dependencies in any order while executing them in the proper order. RequireJS defines modules using a define() function and dependencies are passed as arguments to allow modules to be encapsulated and avoid polluting the global namespace. It also supports optimization to concatenate files for production.
AngularJS is a JavaScript MVC framework developed by Google for building dynamic web applications. It aims to solve issues with traditional HTML by allowing developers to build user interfaces declaratively using templates. Key features include two-way data binding, directives for extending HTML, MVC architecture, dependency injection, and testing capabilities. The document provides examples of using AngularJS for data binding, controllers, routing between views, and loading data from an external API using services. It also lists some advanced concepts like modularity, digesting, and end-to-end testing.
AngularJS is a JavaScript framework developed by Google for building dynamic web applications. It uses MVC architecture and allows developers to write client-side code using HTML as the template language. Some key features include two-way data binding, directives for extending HTML, dependency injection, and testing. The document provides an overview of AngularJS and demonstrates how to build a sample web application for displaying Formula 1 driver standings using AngularJS concepts like controllers, services, expressions, and routing.
AngularJS is a JavaScript framework developed by Google for building dynamic web applications. It uses MVC architecture and allows developers to write client-side code using HTML as the template language. Some key features include two-way data binding, directives for extending HTML, dependency injection, and testing. The document provides an overview of AngularJS and demonstrates how to build a sample web application for displaying Formula 1 driver standings using AngularJS concepts like controllers, services, expressions, and routing.
AngularJS is a JavaScript framework for building dynamic web applications. It uses MVC architecture and allows developers to write client-side code using HTML as the template language. Key features include two-way data binding, directives for extending HTML, dependency injection, and routing. AngularJS aims to solve problems with traditional HTML by making it dynamic and declarative. It separates concerns into models, views, and controllers and uses services to retrieve data from servers.
This document provides an overview of AngularJS, including its history, key features, and how it works. It originated at Google and was open-sourced in 2009. Some key features include two-way data binding, separation of model and view, and being unit testable. It uses MVC architecture with declarative coding. Core concepts covered include directives like ng-app, ng-model, expressions, scopes, controllers, views, filters, routing, and dependency injection.
A complete crash course with 7 pratical labs, to have a head start developing single page applications with Angular. It also contains advanced topics, like Transclusion, Directive to directive communication and UI Router.
High Quality presentation: https://goo.gl/3OwQXf
Download Labs: https://goo.gl/cVI6De
This document discusses JavaScript frameworks and web components. It provides examples of code for Dojo, Ember, Angular, React, and jQuery. It also discusses the benefits of web components, including that they are part of the DOM, future-proof, and modular. Web components include custom elements, shadow DOM, templates, and HTML imports. Browser support is improving but not yet universal. Polyfills exist to provide support in older browsers. The web components specification has changed from version 0 to version 1 to support ES6 classes.
This document provides an overview of key differences between AngularJS 1.x and Angular 2.0. It discusses changes to change detection, routing, services, directives, transpilation to ES5, and dependency injection. Transpilation of Angular 2 code from ES6 to ES5 for browser compatibility is recommended using tools like Babel. Components, services, and directives are defined differently in Angular 2 compared to 1.x. Routing is now done at the component level rather than using routes.
Learning AngularJS - Complete coverage of AngularJS features and conceptsSuresh Patidar
AngularJS learning sessions tailored for 6 days/12 hours. Complete coverage of AngularJS features that will be helpful for both beginner as well as expert. Also covers common development use cases and their answer/solution in AngularJS. A good coverage on tooling required for development and testing.
This document provides an overview of AngularJS, including what it is, its key features, how it works, common terminology, directives, and how to get started using it with Yeoman. AngularJS is an open-source JavaScript framework maintained by Google that assists with building single-page applications using MVC architecture. It features two-way data binding, templates, dependency injection and directives to help organize applications. The document outlines steps for setting up a development environment with Yeoman, creating a sample app, and basic tasks like running and building the app.
This document provides an overview of AngularJS, including what it is, its key features and terminology, how it works, directives, and how to get started using Yeoman to build an AngularJS application. AngularJS is an open-source JavaScript framework that assists with building single-page applications using MVC architecture. It features two-way data binding, templates, dependency injection and directives to help organize applications. Yeoman provides tools like Yo, Grunt and Bower to help set up AngularJS development environments and build projects.
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJSmurtazahaveliwala
First part of AngularJS Training.
Covers details of AngularJs community and answers
- Why AngularJS ?
- What is AngularJS ?
- Getting started
- Basic Application layout and anatomies
- Data-binding, Existing Directives, Filters, Controllers
- Hosting on local (NodeJS) HTTPServer
Code samples available at
https://github.com/murtazahaveliwala/technext-angularjs-demo/tree/master/demos/static/angular-apps
AngularJS 101 - Everything you need to know to get startedStéphane Bégaudeau
In this presentation, you will find everything need to get started with AngularJS.
For more details, have a look at my blog (http://stephanebegaudeau.tumblr.com) or follow me on twitter (@sbegaudeau)
In this presentation, I presented how to build an angular JS Application with SPA in mind and also make sure you use up all the available concepts to create versatile and creative web application with less boilerplate javascript code.
This is a laconic presentation on Angular JS for beginners only. I have emphasized on example rather than theory. There are self explained source code urls attached with slides. In the last slide I have attached source code for a real life example using Angular JS an BootStrap which may be very helpful to understand the concept of Angular JS.
AngularJs Workshop SDP December 28th 2014Ran Wahle
This document provides an overview and agenda for a training on AngularJS. It introduces key concepts in AngularJS like modules, dependency injection, data binding with controllers and scopes, services, filters, directives, forms, and routing. Code examples are provided to demonstrate creating modules, controllers, services, binding data between the view and model, and using built-in and custom directives. The training will cover building AngularJS applications with a focus on best practices.
AngularJS is a structural framework for dynamic web apps. It lets you use HTML as your template language and lets you extend HTML's syntax to express your application's components clearly and succinctly. AngularJS's data binding and dependency injection eliminate much of the code you would otherwise have to write. And it all happens within the browser, making it an ideal partner with any server technology.
Angular workshop - Full Development GuideNitin Giri
AngularJS provides powerful tools for building single page applications, including data binding, scopes, controllers, directives, filters and forms validation. It follows an MVC pattern with two-way data binding between models and views. Key features include directives for creating custom HTML elements, filters for formatting data and built-in validation for forms. AngularJS aims to improve frontend development by reducing code and server interactions.
AngularJS is a structural framework for dynamic web apps. It lets you use HTML as your template language and lets you extend HTML's syntax to express your application's components clearly and succinctly. AngularJS's data binding and dependency injection eliminate much of the code you would otherwise have to write.
Similar to ME vs WEB - AngularJS Fundamentals (20)
Software development... for all? (keynote at ICSOFT'2024)miso_uam
Our world runs on software. It governs all major aspects of our life. It is an enabler for research and innovation, and is critical for business competitivity. Traditional software engineering techniques have achieved high effectiveness, but still may fall short on delivering software at the accelerated pace and with the increasing quality that future scenarios will require.
To attack this issue, some software paradigms raise the automation of software development via higher levels of abstraction through domain-specific languages (e.g., in model-driven engineering) and empowering non-professional developers with the possibility to build their own software (e.g., in low-code development approaches). In a software-demanding world, this is an attractive possibility, and perhaps -- paraphrasing Andy Warhol -- "in the future, everyone will be a developer for 15 minutes". However, to make this possible, methods are required to tweak languages to their context of use (crucial given the diversity of backgrounds and purposes), and the assistance to developers throughout the development process (especially critical for non-professionals).
In this keynote talk at ICSOFT'2024 I presented enabling techniques for this vision, supporting the creation of families of domain-specific languages, their adaptation to the usage context; and the augmentation of low-code environments with assistants and recommender systems to guide developers (professional or not) in the development process.
NBFC Software: Optimize Your Non-Banking Financial CompanyNBFC Softwares
NBFC Software: Optimize Your Non-Banking Financial Company
Enhance Your Financial Services with Comprehensive NBFC Software
NBFC software provides a complete solution for non-banking financial companies, streamlining banking and accounting functions to reduce operational costs. Our software is designed to meet the diverse needs of NBFCs, including investment banks, insurance companies, and hedge funds.
Key Features of NBFC Software:
Centralized Database: Facilitates inter-branch collaboration and smooth operations with a unified platform.
Automation: Simplifies loan lifecycle management and account maintenance, ensuring efficient delivery of financial services.
Customization: Highly customizable to fit specific business needs, offering flexibility in managing various loan types such as home loans, mortgage loans, personal loans, and more.
Security: Ensures safe and secure handling of financial transactions and sensitive data.
User-Friendly Interface: Designed to be intuitive and easy to use, reducing the learning curve for employees.
Cost-Effective: Reduces the need for additional manpower by automating tasks, making it a budget-friendly solution. Benefits of NBFC Software:
Go Paperless: Transition to a fully digital operation, eliminating offline work.
Transparency: Enables managers and executives to monitor various points of the banking process easily.
Defaulter Tracking: Helps track loan defaulters, maintaining a healthy loan management system.
Increased Accessibility: Cutting-edge technology increases the accessibility and usability of NBFC operations. Request a Demo Now!
What is OCR Technology and How to Extract Text from Any Image for FreeTwisterTools
Discover the fascinating world of Optical Character Recognition (OCR) technology with our comprehensive presentation. Learn how OCR converts various types of documents, such as scanned paper documents, PDFs, or images captured by a digital camera, into editable and searchable data. Dive into the history, modern applications, and future trends of OCR technology. Get step-by-step instructions on how to extract text from any image online for free using a simple tool, along with best practices for OCR image preparation. Ideal for professionals, students, and tech enthusiasts looking to harness the power of OCR.
Are you wondering how to migrate to the Cloud? At the ITB session, we addressed the challenge of managing multiple ColdFusion licenses and AWS EC2 instances. Discover how you can consolidate with just one EC2 instance capable of running over 50 apps using CommandBox ColdFusion. This solution supports both ColdFusion flavors and includes cb-websites, a GoLang binary for managing CommandBox websites.
An MVP (Minimum Viable Product) mobile application is a streamlined version of a mobile app that includes only the core features necessary to address the primary needs of its users. The purpose of an MVP is to validate the app concept with minimal resources, gather user feedback, and identify any areas for improvement before investing in a full-scale development. This approach allows businesses to quickly launch their app, test its market viability, and make data-driven decisions for future enhancements, ensuring a higher likelihood of success and user satisfaction.
Discover the Power of ONEMONITAR: The Ultimate Mobile Spy App for Android Dev...onemonitarsoftware
Unlock the full potential of mobile monitoring with ONEMONITAR. Our advanced and discreet app offers a comprehensive suite of features, including hidden call recording, real-time GPS tracking, message monitoring, and much more.
Perfect for parents, employers, and anyone needing a reliable solution, ONEMONITAR ensures you stay informed and in control. Explore the key features of ONEMONITAR and see why it’s the trusted choice for Android device monitoring.
Share this infographic to spread the word about the ultimate mobile spy app!
COMPSAC 2024 D&I Panel: Charting a Course for Equity: Strategies for Overcomi...Hironori Washizaki
Hironori Washizaki, "Charting a Course for Equity: Strategies for Overcoming Challenges and Promoting Inclusion in the Metaverse", IEEE COMPSAC 2024 D&I Panel, 2024.
In this talk, we will explore strategies to optimize the success rate of storing and retaining new information. We will discuss scientifically proven ideal learning intervals and content structures. Additionally, we will examine how to create an environment that improves our focus while you remain in the “flow”. Lastly we will also address the influence of AI on learning capabilities.
In the dynamic field of software development, this knowledge will empower you to accelerate your learning curve and support others in their learning journeys.
A captivating AI chatbot PowerPoint presentation is made with a striking backdrop in order to attract a wider audience. Select this template featuring several AI chatbot visuals to boost audience engagement and spontaneity. With the aid of this multi-colored template, you may make a compelling presentation and get extra bonuses. To easily elucidate your ideas, choose a typeface with vibrant colors. You can include your data regarding utilizing the chatbot methodology to the remaining half of the template.
IN Dubai [WHATSAPP:Only (+971588192166**)] Abortion Pills For Sale In Dubai** UAE** Mifepristone and Misoprostol Tablets Available In Dubai** UAE
CONTACT DR. SINDY Whatsapp +971588192166* We Have Abortion Pills / Cytotec Tablets /Mifegest Kit Available in Dubai** Sharjah** Abudhabi** Ajman** Alain** Fujairah** Ras Al Khaimah** Umm Al Quwain** UAE** Buy cytotec in Dubai +971588192166* '''Abortion Pills near me DUBAI | ABU DHABI|UAE. Price of Misoprostol** Cytotec” +971588192166* ' Dr.SINDY ''BUY ABORTION PILLS MIFEGEST KIT** MISOPROSTOL** CYTOTEC PILLS IN DUBAI** ABU DHABI**UAE'' Contact me now via What's App… abortion pills in dubai Mtp-Kit Prices
abortion pills available in dubai/abortion pills for sale in dubai/abortion pills in uae/cytotec dubai/abortion pills in abu dhabi/abortion pills available in abu dhabi/abortion tablets in uae
… abortion Pills Cytotec also available Oman Qatar Doha Saudi Arabia Bahrain Above all** Cytotec Abortion Pills are Available In Dubai / UAE** you will be very happy to do abortion in Dubai we are providing cytotec 200mg abortion pills in Dubai** UAE. Medication abortion offers an alternative to Surgical Abortion for women in the early weeks of pregnancy. We only offer abortion pills from 1 week-6 Months. We then advise you to use surgery if it's beyond 6 months. Our Abu Dhabi** Ajman** Al Ain** Dubai** Fujairah** Ras Al Khaimah (RAK)** Sharjah** Umm Al Quwain (UAQ) United Arab Emirates Abortion Clinic provides the safest and most advanced techniques for providing non-surgical** medical and surgical abortion methods for early through late second trimester** including the Abortion By Pill Procedure (RU 486** Mifeprex** Mifepristone** early options French Abortion Pill)** Tamoxifen** Methotrexate and Cytotec (Misoprostol). The Abu Dhabi** United Arab Emirates Abortion Clinic performs Same Day Abortion Procedure using medications that are taken on the first day of the office visit and will cause the abortion to occur generally within 4 to 6 hours (as early as 30 minutes) for patients who are 3 to 12 weeks pregnant. When Mifepristone and Misoprostol are used** 50% of patients complete in 4 to 6 hours; 75% to 80% in 12 hours; and 90% in 24 hours. We use a regimen that allows for completion without the need for surgery 99% of the time. All advanced second trimester and late term pregnancies at our Tampa clinic (17 to 24 weeks or greater) can be completed within 24 hours or less 99% of the time without the need for surgery. The procedure is completed with minimal to no complications. Our Women's Health Center located in Abu Dhabi** United Arab Emirates** uses the latest medications for medical abortions (RU-486** Mifeprex** Mifegyne** Mifepristone** early options French abortion pill)** Methotrexate and Cytotec (Misoprostol). The safety standards of our Abu Dhabi** United Arab Emirates Abortion Doctors remain unparalleled. They consistently maintain the lowest complication rates throughout the nation. Our
7. jQuery
▣ Started as DOM manipulation tool
▣ Became an all-in-one javascript library
□ without much forethoughts
▣ Our best friend back then, until..
9. jQuery + Webapp = Headaches
▣ Structureless spaghetti code
□ Total code mess
▣ Selectors creating tight coupling
□ Non-reusable code
▣ Not enough high level abstractions
□ A lot of code required to be written
13. backbone.js
▣ Solved
□ No more spaghetti code
▣ NOT Solved
□ Selectors creating tight coupling
□ Not enough high level abstractions
14. What about High Level Abstractions?
▣ Backbone is unopinionated.
▣ It lacks the necessary tools to easily manage
any webapp above a certain threshold in
complexity
▣ The bottom line - Backbone asks you to write
A Lot More Code to get what you want
15. And the earth was without form,
and void; and darkness wasupon
the face of the deep
16. ‘’
And the earth was without
form, and void; and darkness
wasupon the face of the deep
And God said:
Let there be light..
17. ‘’
And the earth was without
form, and void; and darkness
wasupon the face of the deep
And God said:
Let there be light..
22. It’s not one or another
▣ Angular does not replace jQuery!
▣ jQuery library is the undoubted king of a DOM
manipulation
23. Angular’s Role
▣ Angular offers a comprehensive framework to
develop front-end applications
▣ Actually Angular provides jqLite out of the
box
□ a jQuery-like library that provides a subset of
jQuery functionality
25. ‘’
AngularJS is:
1.a powerful Front-end
JavaScript framework
1.Extends HTML to build
complex web applications
1.Organizes JavaScript code
into reusable components
26. How things worked before:
JS
HTML
Structure
Behavior
CSSPresentation
28. Why Angular
▣ Component based - Code reuse
▣ Extends HTML by adding directives, custom
tags, attributes, expressions, templates within
HTML
▣ Data Binding and Dependency Injection
□ Everything is communicated automatically
▣ Dependency-injected code for easy testing
and TDD
29. The major features of AngularJS
▣ Easy Data Binding: Two way Data Binding
▣ Reusable Components - Directives
▣ Dependency injection
▣ Routing
▣ Templating
▣ Modules
▣ Controllers
▣ Services
▣ Expressions
▣ Filters
▣ Form Validation
▣ $scope, $http, $routeProvides..
32. Two-way Binding
▣ Any changes in the scope are reflected in the
view, and any user interactions with the view
are reflected in the scope model.
▣ This makes the scope model the single source
of truth
34. VIEW
define the data and methods that
will be available for the view
MODELbusiness logic
Html Template
$scope (VM)
Two-way Data-
Binding
Commands
Commands Change Notifications
What architecture is it?
42. Modules (HTML side)
▣ All AngularJS JavaScript code is stored in
modules
▣ And a module is attached to a page
var app = angular.module('myApp', ['otherModule', 'anotherModule']);
<html ng-app="myApp"> ... </html>
43. Modules (Javascript)
▣ Modules are used to define services, controllers,
directives and filters
▣ Each module member is a constructor which can
inject other services
app.factory('myValues', function() {
return function() {
return [1,2,3,4,5,6];
};
});
app.filter('skipFirstValue', function() {
return function(data) {
return data.slice(1);
}
});
app.run(function($rootScope, myValues, skipFirstValueFilter) {
//this is called when the page is loaded
$rootScope.values = skipFirstValue(myValues());
});
44. $scope
▣ The scope is the glue between JavaScript and
HTML in AngularJS
▣ Anything placed on the $scope object can be
referenced in HTML
<div ng-controller="AppCtrl">
Hello, so far I have <strong>{{ totalApples }} </strong> apples.
<button ng-click="moreApples()">Give me more!</button>
</div>
app.controller('AppCtrl', function($scope) {
$scope.totalApples = 0;
$scope.moreApples = function() {
$scope.totalApples++;
}
});
46. Controllers
▣ Controllers are defined inside of a module like
all other services
app.controller('AppCtrl', function($scope) { ... });
47. Controllers
▣ And they can be referenced in HTML using
ng-controller (Or within routes..)
<html ng-app>
<head>
<script src='angular.js'></script>
<script src='controllers.js'></script>
</head>
<body ng-controller='UserController'>
<div>Hi {{user.name}}</div>
</body>
</html>
function UserController($scope) {
$scope.user = { name:'Larry' };
}
index.html
controllers.js
49. AJAX using $http
▣ Use $http to perform an AJAX request
▣ The scope will automatically update itself
when $http returns gets a response
var app = angular.module('myApp', []);
app.controller('ColorsCtrl', function($scope, $http) {
$scope.colors = $http.get('/api/colors.json');
});
51. No more HTML mess
Today’s websites have giant series of <div> with
extensive and exhaustive CSS, causing little
semantic clarity.
With Angular you can create your own tags and
attributes using Directives.
52. Directives
▣ Special custom components in HTML
▣ The directives can be placed in element
names, attributes, class names, as well as
comments.
▣ Directives are a way to teach HTML new
tricks.
<div my-precious-element></div>
53. Directives
▣ Handled in JavaScript via DOM manipulation
▣ A directive is just a function which executes
when the compiler encounters it in the DOM.
app.directive('myPreciousElement', function() {
return function($scope, element, attrs) {
element.bind('click', function() {
alert('clicked!');
});
};
});
54. Possible usage of directives
<rating max='5' model='stars.average'>
<tabs>
<tab title='Active tab' view='...'>
<tab title='Inactive tab' view='...'>
</tabs>
<tooltip content='messages.tip1'>
55. Built-in Directives
▣ AngularJS provides series of predefined HTML
components
▣ These components reduce much of the
JavaScript required to make HTML appear
dynamic
58. HTML Compiler
▣ Angular’s HTML compiler allows the
developer to teach the browser new HTML
syntax.
▣ The compiler allows you to attach behavior to
any HTML element or attribute and even
create new HTML elements or attributes with
custom behavior.
▣ Angular calls these behavior extensions
directives.
59. How the HTML Compiler works
▣ Compiler is an angular service which traverses
the DOM looking for attributes.
▣ The compilation process happens in two
phases:
□ Compile: traverse the DOM and collect all of the
directives. The result is a linking function.
□ Link: combine the directives with a scope and
produce a live view.