SlideShare a Scribd company logo
© Copyright SELA Software & Education Labs, Ltd. | 14-18 Baruch Hirsch St., Bnei Brak, 51202 Israel | www.selagroup.com
SELA DEVELOPER PRACTICE
December 28th – January 1st, 2014
Ran Wahle
AngularJS – from 0 to 60
Agenda
Introduction
Modules and dependency injection
Data binding, controllers and scopes
Services
Filters
Directives
Form validation
Routing
The Modern Web
From web pages to web applications
More and more logic is pushed to the client
The Problem
As we add more and more JavaScript, our
application is getting:

Recommended for you

Angular Js Basics
Angular Js BasicsAngular Js Basics
Angular Js Basics

This document provides an introduction and overview of AngularJS including its main concepts such as MVC, dependency injection, directives, filters, data binding, routing and REST services. It also discusses Angular scaffolding tools like Yeoman and provides examples of building an Angular application including fetching data from REST APIs and implementing routing. The document contains an agenda with topics and code snippets for controllers, views, directives and services. It also includes exercises for practicing key AngularJS concepts like data binding, routing and consuming REST services.

Front end development with Angular JS
Front end development with Angular JSFront end development with Angular JS
Front end development with Angular JS

Node package manager (NPM) initializes projects and manages front-end packages. Bower manages client-side packages like jQuery. Grunt and Gulp automate workflows. Yo generates application scaffolding. Angular uses MVC architecture with views, models, and controllers. Data binding syncs models and views. Directives extend HTML. Modules contain components and support dependency injection. Routes define application states. Filters format data. Controllers manipulate scope data. Values, services, and factories support dependency injection of reusable code. Testing uses Karma, Jasmine, and generated test skeletons.

bowerangular jsgrunt
AngularJs presentation
AngularJs presentation AngularJs presentation
AngularJs presentation

What is AngularJS AngularJS main components View / Controller / Module / Scope Scope Inheritance. Two way data binding $watch / $digest / $apply Dirty Checking DI - Dependence Injection $provider vs $factory vs $service

angularjs
Introduction to
AngularJS
What Is AngularJS?
An MV* framework for developing CRUD style web applications
Developed by Google
Works on all modern web browsers
Open source (MIT license)
No external dependencies
Very opinionated
Demo
The Simplest Angular Application
Angular Building Blocks
Module
Module
Module
Scope Controller ServiceTemplate
Filter Directive
Two-Way
Binding
Dependency
Injection
Routing

Recommended for you

Angular workshop - Full Development Guide
Angular workshop - Full Development GuideAngular workshop - Full Development Guide
Angular workshop - Full Development Guide

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.

angularjs1.xweb designweb design and development
Intoduction to Angularjs
Intoduction to AngularjsIntoduction to Angularjs
Intoduction to Angularjs

AngularJS is an open source JavaScript framework for building dynamic web applications. It enhances HTML with custom directives and bindings to enrich client-side web applications with reusable components. Key features include two-way data binding, reusable components, support for MVC/MVVM design patterns, end-to-end testing, cross-browser compatibility, and services. AngularJS allows developers to organize applications into modules and controllers to keep code clean and reusable.

angularjswebmvc
Angular js
Angular jsAngular js
Angular js

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.

<!doctype html>
<html data-ng-app>
<head>
</head>
<body>
<input type="text" data-ng-model="name" />
{{name}}
</body>
</html>
Your first AngularJS page
Module
Divide application into small pieces
Can contain controllers, services, directives, etc.
Can depend on other modules
Other modules can depend on it
//Creating a module
angular.module('yourModuleName', [ /*…dependencies…*/ ]);
//Accessing a module
angular.module('yourModuleName'); //Note: no dependencies array
Creating a module
Dependency Injection
Each angular application has an $injector service
Components are injected by the $injector
There are several options for using dependency
injection

Recommended for you

Introduction to Angular JS
Introduction to Angular JSIntroduction to Angular JS
Introduction to Angular JS

This presentation is an effort to combine all the cool features present in Angular and provide a basic idea about how it would help a developer overcome some of the common issues faced in client side development.

mvcjavascriptangular js
Understanding angular js
Understanding angular jsUnderstanding angular js
Understanding angular js

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.

web developmentprogrammingjavascript
AngularJs (1.x) Presentation
AngularJs (1.x) PresentationAngularJs (1.x) Presentation
AngularJs (1.x) Presentation

AngularJS (1.x) is a client-side framework for developing browser-based applications using model-view-whatever architecture. It was created by Google and is open source. AngularJS uses templates, modules, services, dependency injection and two-way data binding to build single page applications. Key features include bootstrapping, routing, directives and unit testing capabilities. Angular 2 is a complete rewrite of AngularJS and uses only class-based services rather than multiple options.

angularjs (1.x)angularjs presentation
One option removes the responsibility of locating the
dependency from the component. The dependency is simply
handed to the component.
In Angular each application has an injector that is responsible
for construction and lookup of dependencies
function SomeClass(greeter) {
this.greeter = greeter;
}
SomeClass.prototype.doSomething = function(name) {
this.greeter.greet(name);
}
Dependency Injection cont.
Creating a component
angular.module('yourModuleName').service('serviceName', function() {
//service’s code
});
Creating an Angular component
Consuming the component
angular.module('yourModuleName')
.controller('controllerName', ['serviceName', function(serviceName) {
//controller’s code
});
© Copyright SELA software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com
Data binding
Controllers, scopes and views
AngularJS supports MV *- patterns
Views
HTML
templates
Controllers
JavaScript
functions
Data Model
$scope

Recommended for you

Angular Js Get Started - Complete Course
Angular Js Get Started - Complete CourseAngular Js Get Started - Complete Course
Angular Js Get Started - Complete Course

This document provides an introduction and overview of AngularJS, including: - AngularJS is a JavaScript framework for building dynamic web applications and sites. It allows building applications that run in web browsers using HTML. - Key AngularJS concepts covered include directives, controllers, modules, services, filters, forms, routing and two-way data binding. - Examples are provided to demonstrate how to create AngularJS applications, controllers, directives, filters and more. - Custom directives and services can be created to extend the functionality of AngularJS applications.

webweb designwebsite
Dynamic Application Development by NodeJS ,AngularJS with OrientDB
Dynamic Application Development by NodeJS ,AngularJS with OrientDBDynamic Application Development by NodeJS ,AngularJS with OrientDB
Dynamic Application Development by NodeJS ,AngularJS with OrientDB

This document provides an overview of NodeJS, AngularJS, and how they can be used together with OrientDB for building dynamic applications. It discusses key concepts like non-blocking I/O in NodeJS, MVC architecture in AngularJS, data binding, directives, routing. It also compares performance of NodeJS vs Apache and explains why Angular and NoSQL are well-suited for dynamic applications that require frequent changes - since only the data model and view layers need changes, without requiring changes to the controller code or database schema.

Angular2 and TypeScript
Angular2 and TypeScriptAngular2 and TypeScript
Angular2 and TypeScript

This document discusses building powerful enterprise applications with Angular and TypeScript. It provides an overview of key concepts in Angular including modules, components, templates, directives, services, routing and data binding. It also covers TypeScript features such as static type checking, transpiling to JavaScript, and advantages for productivity and managing large codebases. The document demonstrates how Angular and TypeScript can be used together to build robust single page applications.

angujavascriptweb
HTML templates
An HTML element with Angular-related attributes
Declarative
Contains Angular-specific elements and attributes
Contains expressions evaluated against scope
properties
<html>
<head>
</head>
<body data-ng-app="myAppName">
<div data-ng-controller="myController">
<input data-ng-model="name" />
<button data-ng-click="greet()">Greet</button>
</div>
</body>
</html>
HTML template
Controller
A JavaScript constructor function
Contains view related logic
Can get and set data on the $scope
Shouldn’t have any DOM related functionality
Sets up the $scope initial state
Associated with a template via the ng-controller directive
angular.module('myAppName')
.controller('myController', ['$scope', function($scope) {
var greet = function() {
alert('Hello ' + $scope.name);
};
$scope.greet = greet;
}]);
Controller

Recommended for you

Valentine with AngularJS
Valentine with AngularJSValentine with AngularJS
Valentine with AngularJS

AngularJS is a full-featured framework for building single page applications. It provides features like data binding, routing, templates, dependency injection and directives. The document discusses key AngularJS concepts like directives, filters, views, controllers, scope, modules and routes. Directives allow extending HTML with new syntax and attributes. Filters filter or format data. Views and controllers work with scope to provide the model for the view. Modules are containers for controllers and services. Routes map URLs to controllers and views.

web developmentjavascriptangularjs
Will your code blend? : Toronto Code Camp 2010 : Barry Gervin
Will your code blend? : Toronto Code Camp 2010 : Barry GervinWill your code blend? : Toronto Code Camp 2010 : Barry Gervin
Will your code blend? : Toronto Code Camp 2010 : Barry Gervin

XAML getting you down? Tired of the repetition of trial by error WPF or Silverlight development? If you’re not using Expression Blend to build your XAML, you’re doing it all wrong. Let’s take a look at the common pitfalls that new Silverlight developers fall into that make their code unblendable, and then leverage the patterns and techniques that allow us to unlock the virtues of Expression Blend. Testability, blendability, inner peace and maintainability are just 1 hour away

silverlightexpression blendwpf
Introduction to Unit Tests and TDD
Introduction to Unit Tests and TDDIntroduction to Unit Tests and TDD
Introduction to Unit Tests and TDD

Discover why unit testing is such an important practice in software development and learn about Test Driven Development, mocking and other code testing practices in .Net

unit testingtest driven developmentunit test
$scope
The glue between the HTML template
and the controller
Hierarchical in the same way as HTML
Hierarchy implemented using
JavaScript prototypes
The root scope is represented by the
$rootScope service
Demo
Controllers, views and $scope
Services
Reusable singleton objects
Can be injected into controllers, filters,
directives and other services
Created only when needed
There are many built-in services in
AngularJS
angular.module('myApp')
.service('myService', [/*…dependencies…*/, function(/*…dependencies…*/) {
//service logic here
this.someMethod = function() {};
}]);
angular.module('myApp')
.controller('myController', ['myService', function(myService) {
myService.someMetho();
}]);
Creating and using a service

Recommended for you

Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS

AngularJS is an open source JavaScript framework maintained by Google that extends HTML with new elements and attributes. It uses a Model-View-Whatever architecture to develop single-page applications. Key AngularJS components include directives, expressions, and controllers that allow two-way data binding between models and views.

angularjsjavascript framework
Creating lightweight JS Apps w/ Web Components and lit-html
Creating lightweight JS Apps w/ Web Components and lit-htmlCreating lightweight JS Apps w/ Web Components and lit-html
Creating lightweight JS Apps w/ Web Components and lit-html

What are Web Components and why should we use them, Pros and Cons. What is lit-html and how it helps us develop lightweight JavaScript Apps.

web componentslit-htmlweb
Built-in services
$rootScope
$timeout
$location
$interval
$log
$compile
$rootElement
$parse
$window
$cacheFactory $animate
Demo
Using a service
Ajax using $http
$http service is a built-in service in AngularJS
Used for communicating with the server
Wraps XMLHttpRequest
Automatically serializes/deserializes JSON
Supports request and response
transformation
Supports request and response interception
$http.get('url')
.success(function(response) {
//handle the server's response
})
.error(function(errorResponse) {
//handle the server's error response
});
$http.post('url', requestBody);
$http.put('url', requestBody);
$http.delete('url', requestBody);
Using $http

Recommended for you

Big data vs datawarehousing
Big data vs datawarehousingBig data vs datawarehousing
Big data vs datawarehousing

Big data and data warehousing both aim to extract business value from data. Data warehousing stores structured data from internal systems in a centralized location for analysis. Big data handles large, complex, and unstructured data both within and outside the organization. It uses tools for storage, analysis, and visualization of diverse data types. A case study shows how a shoe company uses both approaches - a data warehouse for core transaction data and big data to analyze external sources and predict customer behavior. While different in scope and data sources, both can provide valuable insights when used together.

nosqlvisualizationbig data
BlueVia SDK for .NET Overview
BlueVia SDK for .NET OverviewBlueVia SDK for .NET Overview
BlueVia SDK for .NET Overview

The BlueVia SDK for .NET allows .NET developers to quickly develop applications that integrate with the BlueVia platform and generate revenue. It uses familiar Visual Studio tools and templates and supports hosting applications in Microsoft Azure. Developers can get started by downloading the SDK, creating a BlueVia account, and using provided templates, documentation, and samples to build cross-platform solutions for PCs, mobile devices, and consoles.

appsblueviabusiness
AFR_TS_Catalog
AFR_TS_CatalogAFR_TS_Catalog
AFR_TS_Catalog

This document is a product catalog from AFR Trade Show Furnishings that provides an overview of their furniture collections for trade shows. It includes descriptions and photos of various sofa, loveseat, chair, ottoman, and table options across 20 collections. The catalog emphasizes AFR's ability to help elevate customer experiences at trade shows through stylish, high-quality furniture pieces and their flexibility to meet last-minute needs through their large warehouse network.

$http({
url: 'url',
method: 'get', //or 'put', 'post', 'delete'
params: {…}, //for get requests
data: {…}, //for put or post requests
}).success(…).error(…).finally(…);
Using $http (Cont)
The $resource Service
An abstraction on top of the $http service for interaction with
RESTful web services
Depends on the ngResource module and requires the inclusion
of the angular-resource.js script
Receives a parameterized URL, with optional default values
Returns an object with convenient methods (get, query, $save,
$delete, …)
Custom actions can be configured as well
Using the $resource service
angular.module('resourceDemo', ['ngResource'])
.controller('questionsCtrl', function($scope) {
var baseUrl = '/api/v1.0/questions/:id';
var Questions = $resource(baseUrl, {id: '@id'});
$scope.loadQuestions = function() {
$scope.questions = Questions.query();
};
$scope.removeQuestion = function(question) {
question.$remove();
};
});
Demo
Using built-in services

Recommended for you

Inside Wijmo 5, a Large-scale JavaScript Product
Inside Wijmo 5, a Large-scale JavaScript ProductInside Wijmo 5, a Large-scale JavaScript Product
Inside Wijmo 5, a Large-scale JavaScript Product

GrapeCity has been developing JavaScript products for over six years. The browser landscape has changed greatly since we started and we have learned a lot along the way. Today, we manage Wijmo 5, a suite of JavaScript UI controls, specializing in a high-performance datagrid and powerful charts. In this session, we will give you a look inside our project. We will go over the collections of tools, frameworks, languages and patterns that we have refined over the years. You walk away from this session with useful tips for managing large-scale JavaScript applications.

angularjshtml5visual studio
Joseph Inbaraj S 11+ years ALM Admin Resume
Joseph Inbaraj S 11+ years ALM Admin ResumeJoseph Inbaraj S 11+ years ALM Admin Resume
Joseph Inbaraj S 11+ years ALM Admin Resume

This document contains a resume for Joseph Inbaraj S. highlighting his 11+ years of experience in software testing using tools like HP ALM, UFT, Loadrunner, and SiteScope. He is currently working as an HP ALM and UFT Consultant for Fly Dubai in Dubai. Previous roles include working as a Test Manager for AffinBank in Malaysia where he managed ALM projects and was responsible for ALM installation, configuration, and customization. He has extensive experience in test automation, performance testing, test management, and ALM administration.

Cryptography
CryptographyCryptography
Cryptography

In this ppt the basic introduction, history,shift cipher method, cipher disk, permutation method and some application of cryptography is included.

educationcyber securitycryptography
Filters
Formats the value of an expression for display to the user
{{ expression | filter }}
{{ 10 | currency }} will display 10$
May have arguments
{{ price | number:2 }}
Chainable
angular.module('myModule')
.filter('digitToText', function() {
var digitToText = [
'zero', 'one', 'two', 'three', 'four',
'five', 'six', 'seven', 'eight', 'nine'
];
return function(digit) {
return digitToText[digit];
};
});
Create a custom filter
Demo
Using filters
The form directive
Aggregates the state of all its input elements
Sets CSS classes according to the state
The default form action is automatically ignored
Available to the scope as a property with the name of the form
Contained input elements are also available by their names, as sub-
properties of the form property

Recommended for you

AngularJS Services
AngularJS ServicesAngularJS Services
AngularJS Services

The document discusses AngularJS $http service and promises. It shows how to make GET and POST requests with $http, configure headers, intercept responses, and handle success and error callbacks with promises. It also covers using the $resource service to encapsulate RESTful requests and responses into objects and shows how to inject dependencies into controllers and services.

angularjs
DSpace UI Prototype Challenge: Spring Boot + Thymeleaf
DSpace UI Prototype Challenge: Spring Boot + ThymeleafDSpace UI Prototype Challenge: Spring Boot + Thymeleaf
DSpace UI Prototype Challenge: Spring Boot + Thymeleaf

Presentation of my user interface prototype (#1) using Spring Boot + Thymeleaf for the DSpace UI Prototype Challenge: https://wiki.duraspace.org/display/DSPACE/DSpace+UI+Prototype+Challenge NOTE: As this was just a prototype/proof-of-concept there are NO GUARANTEES that this work will become a new User interface.

spring bootuser interfacespring security
Business Plan: Photography Business
Business Plan: Photography Business Business Plan: Photography Business
Business Plan: Photography Business

The document is a business plan for a photography business called The Artsy Pixel located in Dhaka, Bangladesh. The business will offer photography and cinematography services including portraits, events, and weddings. It will have a team of photographers, videographers, and editors. The business aims to be the top photography agency in Bangladesh through quality service and a focus on customer satisfaction. Competition comes from other local photography studios but the business sees opportunities in its talented team and providing a variety of packages and services.

wubdhakabangladeshi_director
The form directive
Creates a formController
The formController aggregates the state of all form controls
The formController is available to the current scope by its name
To submit the form using Ajax, respond to ng-submit or ng-click
Built-in validation directives
Angular provides the following validation directives:
required – Checks that the field has a value
min – Checks that the field value is greater than the given value
max – Checks that the field value is lower than the given value
minlength – Checks that the field value is longer than the given value
maxlength – Checks that the field value is shorter than the given value
pattern – Checks that the field value matches the given regular
expression
All of the above directives set a validation error identified by
their name when the condition is not met
The ngModel directive
Provides a two way data binding between the input
element and the model
Provides automatic validation for common HTML5
input types (checkbox, email, number, text, url)
Tracks the control’s state
Sets CSS classes according to the state
Note the usage of the novalidate attribute to disable
the browser’s built-in validation
<form name="form" novalidate>
<div>
<input type="text" name="title" ng-model="question.title" required />
</div>
<div>
<textarea name="content" ng-model="question.content" required>
</textarea>
</div>
<button ng-click="addQuestion(question)”>
Submit
</button>
</form>
Using the form and ngModel directives

Recommended for you

Introduction to Network Security
Introduction to Network SecurityIntroduction to Network Security
Introduction to Network Security

This document outlines the course objectives and contents for a Network Security course at the University of Okara. The course will introduce computer and network security concepts over 10 lectures, including topics like cryptography, encryption algorithms, digital signatures, key management, hashing, VPNs, firewalls, and viruses. Students will complete 3 assignments, 3 exercises per lecture, a final project, and case study. The course aims to explain network security in the context of protecting network resources and data, rather than just computers or individual data. It will also cover the history and basic definitions of security, like defining it as protecting systems from harm and preserving the confidentiality, integrity and availability of information.

introduction to Angularjs basics
introduction to Angularjs basicsintroduction to Angularjs basics
introduction to Angularjs basics

Angularjs is a client side javascript framework that adds interactivity to HTML. It allows developers to create dynamic and interactive web applications. Some key features include directives, modules, controllers, expressions and data binding. Directives are HTML annotations that trigger javascript behaviors. Modules group application components. Controllers add application logic and behavior. Expressions display dynamic values in the HTML. Angularjs uses MVC architecture with the view being the DOM, controllers handling logic, and models storing data. It also utilizes dependency injection to manage dependencies between components.

spaangularjsnodejs
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJSAngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS

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

trainingangularjstechnology
Demo
Using forms
Directives
Custom HTML elements, attributes, classes and
comments that are recognized by Angular
Essentially extend the existing HTML vocabulary
Creating new elements
Adding behavior to existing elements
Most of the things we’ve seen so far are built-in
directives (ng-app, ng-controller, ng-repeat, ng-
model, required, …)
Creating custom directives
Directives are registered on modules, with the
module.directive function, which takes the
directive name and a factory function
The factory function should return a directive
definition object (discussed in the following
slides)
It’s a best practice to prefix custom directives to
prevent collision with other 3rd party directives,
or a future standard
The following code demonstrates the definition
of a new directive, named myDirective
Note that this is a only a skeleton with an
empty directive definition object. We’ll fill this
object with properties in the following slides.
myModule.directive('myDirective', function() {
return {
};
});
Creating a custom directive

Recommended for you

Introduction to single page application with angular js
Introduction to single page application with angular jsIntroduction to single page application with angular js
Introduction to single page application with angular js

This document summarizes a presentation on AngularJS. It introduces AngularJS as a JavaScript framework for building single-page applications. It covers key AngularJS concepts like modules, controllers, views, directives, routing, services, filters and custom directives. It also provides examples of creating modules, controllers and views, using directives for data binding, implementing routing and dependency injection. The presentation concludes by discussing upcoming topics like custom directives, isolated scopes, services and testing with AngularJS.

angularjsangular.jsjavascript
Angular Presentation
Angular PresentationAngular Presentation
Angular Presentation

This document provides an overview of key concepts in AngularJS including two-way data binding, directives, modules, controllers, expressions, validation, filters, services, dependency injection, and custom directives and services. It explains how AngularJS uses directives, modules, and controllers to organize code. It also covers core functions like data binding, validation, filters, and dependency injection via the injector.

Angular js
Angular jsAngular js
Angular js

AngularJS is an open-source JavaScript framework for building client-side web applications. It facilitates the creation of single-page applications using Model-View-Controller architecture. Key aspects of AngularJS include data binding, directives, dependency injection, services, filters and forms. It promotes declarative programming for templates and imperative code for controllers and logic. AngularJS makes it easier to write modular code through services and dependency injection. It also simplifies communication with backend servers via the $http service and $resource for RESTful APIs.

angularjs
Create a custom directive
The object retuned can have the
following properties:
• link: a function that is called during the linking phase
• template: an HTML template for the directive
• templateUrl: a rooted path to an HTML template file
• require: specifies a dependency on another directive
• transclude: determines whether child elements should
be included in the template
• controller: used to share behavior and communicate
with other directives
Demo
Custom directives
Routing in Single Page Applications
Unlike traditional web sites, in SPAs, the
responsibility for rendering the view is on the client
side
We do, however, want to give the user the same
features they are used to, such as:
The browser’s navigation buttons
The address bar for navigation
The ability to bookmark specific pages
How can we change the address bar without causing
the browser to issue a new request?
The $location service
An abstraction on top of the window.location
object
Synchronized with the browser address bar and
allows to watch or manipulate the URL
Seamless integration with the HTML5 History API.
Links are automatically rewritten to reflect the
supported mode.
<a href="/page1?id=123">link</a>
/index.html#/page1?id=123
/page1?id=123

Recommended for you

AngularJS in 60ish Minutes
AngularJS in 60ish MinutesAngularJS in 60ish Minutes
AngularJS in 60ish Minutes

This is a talk I gave the at the AngleBrackets/DevIntersection conference in April of 2014 that covers the AngularJS JavaScript framework (one of my favorite frameworks out there!). In this talk I discussed the challenges with Single Page Applications (SPA) and how AngularJS helps solve those challenges with built-in support for two-way data binding, directives and filters, controllers and more. I also discuss the relationship of modules to controllers, factories and services, and more.

html5angularjsspa
AngularJS
AngularJSAngularJS
AngularJS

The document provides an agenda and overview of key concepts in AngularJS including single page applications, directives, data binding, MVC pattern, modules, routes, factories and services. It discusses downloading and setting up AngularJS, its building blocks like views, controllers and models. It also provides examples of using directives for data binding, iteration, conditional display, and creating custom directives.

Angularjs Basics
Angularjs BasicsAngularjs Basics
Angularjs Basics

The document discusses how web pages are created using HTML, CSS, and JavaScript. It explains the Document Object Model (DOM) and how JavaScript can manipulate the DOM. It then provides an overview of AngularJS including what it is, how it works, and some key concepts like directives, dependency injection, services, and data binding.

javascriptangularjsangulajs
The ui.router module
Angular comes with a built-in router named ngRoute
But most projects use the 3rd party AngularUI Router
The AngularUI Router is packaged in its own module,
named ui.router
To use the router, perform the following steps:
Install and reference the angular-ui-router.js script in the HTML
Add the ui.router module as a dependency to your module
Routes are registered in the module’s config
function, by calling the $stateProvider.state
method with a state name and a route object
A default route can be registered with the
$routeProvider.otherwise method
The contents of the route object are discussed in
the following slides
myModule.config(function($stateProvider) {
$stateProvider("page1", {url: '/page1', …})
.state("page2", {…})
.state("page3", {…})
});
Route registration
The 3rd party uiView directive marks the place in
which the new route’s template should be
rendered
Can be used as an element, or as an attribute on
any element
<body ng-app="myModule">
<div>
<ul>
<li><a ui-sref="page1">Page 1</a></li>
<li><a ui-sref="page2">Page 2</a></li>
</ul>
</div>
<div ui-view />
</body>
The uiView directive
Demo
Routing

Recommended for you

Leveling up with AngularJS
Leveling up with AngularJSLeveling up with AngularJS
Leveling up with AngularJS

Get up to speed and level up your skills so we can understand core concepts and develop complex web applications more effectively. Plunkers to check out: Scope http://plnkr.co/edit/wruApVb8kh1tttJwkQAP?p=preview Two-way data binding & ngModel http://plnkr.co/edit/yJ1jKHO1dpkfsVbMKBu9?p=preview ngRepeat Directive http://plnkr.co/edit/Fe5GvSmFQNnsWjUW0qeu?p=preview Filters & ngModel http://plnkr.co/edit/eIr8Ajzi9zPo5PA8U7nk?p=preview Login Service http://plnkr.co/edit/hf1WxgMr9u1HVQuGv1l6?p=preview Services used to communicate between controllers http://plnkr.co/edit/I1rBFI?p=preview Service vs provider vs factory http://plnkr.co/edit/kh1YsJmcozzSSqur20Zt?p=preview Routes http://plnkr.co/edit/UZRpIHdtmQJgOmCquLQ3?p=preview

javascriptangulardirective
MVC Training Part 2
MVC Training Part 2MVC Training Part 2
MVC Training Part 2

This document discusses several key concepts in ASP.NET MVC including areas, HTML helpers, partial views, dependency injection, model validation, and asynchronous controller actions. It provides code examples for creating an area, partial view, unit tests, and using model attributes for validation. The document is intended to be part of an ASP.NET MVC training and covers important topics like routing, generating HTML, reusing views, testing, and asynchronous programming.

mvcasp.net
Angular
AngularAngular
Angular

This document provides an overview of AngularJS, including its features, directives, filters, data binding, views, controllers, modules, and factories. It discusses key AngularJS concepts like single page applications, directives like ng-repeat and ng-model, filters, creating controllers within modules, and using factories. It also covers creating custom directives, dependency injection with $inject, and the differences between values, services, factories and providers in AngularJS.

Modules and dependency injection
Data binding, controllers and scopes
Services
Filters
Form validation
Directives
Routing
Email: ranw@sela.co.il
Summary
Questions

More Related Content

What's hot

Angular JS - Introduction
Angular JS - IntroductionAngular JS - Introduction
Angular JS - Introduction
Sagar Acharya
 
Introduction to Angularjs
Introduction to AngularjsIntroduction to Angularjs
Introduction to Angularjs
Manish Shekhawat
 
Angular js 1.3 presentation for fed nov 2014
Angular js 1.3 presentation for fed   nov 2014Angular js 1.3 presentation for fed   nov 2014
Angular js 1.3 presentation for fed nov 2014
Sarah Hudson
 
Angular Js Basics
Angular Js BasicsAngular Js Basics
Angular Js Basics
أحمد عبد الوهاب
 
Front end development with Angular JS
Front end development with Angular JSFront end development with Angular JS
Front end development with Angular JS
Bipin
 
AngularJs presentation
AngularJs presentation AngularJs presentation
AngularJs presentation
Phan Tuan
 
Angular workshop - Full Development Guide
Angular workshop - Full Development GuideAngular workshop - Full Development Guide
Angular workshop - Full Development Guide
Nitin Giri
 
Intoduction to Angularjs
Intoduction to AngularjsIntoduction to Angularjs
Intoduction to Angularjs
Gaurav Agrawal
 
Angular js
Angular jsAngular js
Angular js
Manav Prasad
 
Introduction to Angular JS
Introduction to Angular JSIntroduction to Angular JS
Introduction to Angular JS
Santhosh Kumar Srinivasan
 
Understanding angular js
Understanding angular jsUnderstanding angular js
Understanding angular js
Aayush Shrestha
 
AngularJs (1.x) Presentation
AngularJs (1.x) PresentationAngularJs (1.x) Presentation
AngularJs (1.x) Presentation
Raghubir Singh
 
Angular Js Get Started - Complete Course
Angular Js Get Started - Complete CourseAngular Js Get Started - Complete Course
Angular Js Get Started - Complete Course
EPAM Systems
 
Dynamic Application Development by NodeJS ,AngularJS with OrientDB
Dynamic Application Development by NodeJS ,AngularJS with OrientDBDynamic Application Development by NodeJS ,AngularJS with OrientDB
Dynamic Application Development by NodeJS ,AngularJS with OrientDB
Apaichon Punopas
 
Angular2 and TypeScript
Angular2 and TypeScriptAngular2 and TypeScript
Angular2 and TypeScript
David Giard
 
Valentine with AngularJS
Valentine with AngularJSValentine with AngularJS
Valentine with AngularJS
Vidyasagar Machupalli
 
Will your code blend? : Toronto Code Camp 2010 : Barry Gervin
Will your code blend? : Toronto Code Camp 2010 : Barry GervinWill your code blend? : Toronto Code Camp 2010 : Barry Gervin
Will your code blend? : Toronto Code Camp 2010 : Barry Gervin
Barry Gervin
 
Introduction to Unit Tests and TDD
Introduction to Unit Tests and TDDIntroduction to Unit Tests and TDD
Introduction to Unit Tests and TDD
Betclic Everest Group Tech Team
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
David Parsons
 
Creating lightweight JS Apps w/ Web Components and lit-html
Creating lightweight JS Apps w/ Web Components and lit-htmlCreating lightweight JS Apps w/ Web Components and lit-html
Creating lightweight JS Apps w/ Web Components and lit-html
Ilia Idakiev
 

What's hot (20)

Angular JS - Introduction
Angular JS - IntroductionAngular JS - Introduction
Angular JS - Introduction
 
Introduction to Angularjs
Introduction to AngularjsIntroduction to Angularjs
Introduction to Angularjs
 
Angular js 1.3 presentation for fed nov 2014
Angular js 1.3 presentation for fed   nov 2014Angular js 1.3 presentation for fed   nov 2014
Angular js 1.3 presentation for fed nov 2014
 
Angular Js Basics
Angular Js BasicsAngular Js Basics
Angular Js Basics
 
Front end development with Angular JS
Front end development with Angular JSFront end development with Angular JS
Front end development with Angular JS
 
AngularJs presentation
AngularJs presentation AngularJs presentation
AngularJs presentation
 
Angular workshop - Full Development Guide
Angular workshop - Full Development GuideAngular workshop - Full Development Guide
Angular workshop - Full Development Guide
 
Intoduction to Angularjs
Intoduction to AngularjsIntoduction to Angularjs
Intoduction to Angularjs
 
Angular js
Angular jsAngular js
Angular js
 
Introduction to Angular JS
Introduction to Angular JSIntroduction to Angular JS
Introduction to Angular JS
 
Understanding angular js
Understanding angular jsUnderstanding angular js
Understanding angular js
 
AngularJs (1.x) Presentation
AngularJs (1.x) PresentationAngularJs (1.x) Presentation
AngularJs (1.x) Presentation
 
Angular Js Get Started - Complete Course
Angular Js Get Started - Complete CourseAngular Js Get Started - Complete Course
Angular Js Get Started - Complete Course
 
Dynamic Application Development by NodeJS ,AngularJS with OrientDB
Dynamic Application Development by NodeJS ,AngularJS with OrientDBDynamic Application Development by NodeJS ,AngularJS with OrientDB
Dynamic Application Development by NodeJS ,AngularJS with OrientDB
 
Angular2 and TypeScript
Angular2 and TypeScriptAngular2 and TypeScript
Angular2 and TypeScript
 
Valentine with AngularJS
Valentine with AngularJSValentine with AngularJS
Valentine with AngularJS
 
Will your code blend? : Toronto Code Camp 2010 : Barry Gervin
Will your code blend? : Toronto Code Camp 2010 : Barry GervinWill your code blend? : Toronto Code Camp 2010 : Barry Gervin
Will your code blend? : Toronto Code Camp 2010 : Barry Gervin
 
Introduction to Unit Tests and TDD
Introduction to Unit Tests and TDDIntroduction to Unit Tests and TDD
Introduction to Unit Tests and TDD
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
Creating lightweight JS Apps w/ Web Components and lit-html
Creating lightweight JS Apps w/ Web Components and lit-htmlCreating lightweight JS Apps w/ Web Components and lit-html
Creating lightweight JS Apps w/ Web Components and lit-html
 

Viewers also liked

Big data vs datawarehousing
Big data vs datawarehousingBig data vs datawarehousing
Big data vs datawarehousing
Tshegofatso Mogomotsi
 
BlueVia SDK for .NET Overview
BlueVia SDK for .NET OverviewBlueVia SDK for .NET Overview
BlueVia SDK for .NET Overview
BlueVia
 
AFR_TS_Catalog
AFR_TS_CatalogAFR_TS_Catalog
AFR_TS_Catalog
Pat Sherman
 
Inside Wijmo 5, a Large-scale JavaScript Product
Inside Wijmo 5, a Large-scale JavaScript ProductInside Wijmo 5, a Large-scale JavaScript Product
Inside Wijmo 5, a Large-scale JavaScript Product
Chris Bannon
 
Joseph Inbaraj S 11+ years ALM Admin Resume
Joseph Inbaraj S 11+ years ALM Admin ResumeJoseph Inbaraj S 11+ years ALM Admin Resume
Joseph Inbaraj S 11+ years ALM Admin Resume
qtpjoseph
 
Cryptography
CryptographyCryptography
Cryptography
milanmath
 
AngularJS Services
AngularJS ServicesAngularJS Services
AngularJS Services
Eyal Vardi
 
DSpace UI Prototype Challenge: Spring Boot + Thymeleaf
DSpace UI Prototype Challenge: Spring Boot + ThymeleafDSpace UI Prototype Challenge: Spring Boot + Thymeleaf
DSpace UI Prototype Challenge: Spring Boot + Thymeleaf
Tim Donohue
 
Business Plan: Photography Business
Business Plan: Photography Business Business Plan: Photography Business
Business Plan: Photography Business
Moin Sarker
 
Introduction to Network Security
Introduction to Network SecurityIntroduction to Network Security
Introduction to Network Security
Computing Cage
 

Viewers also liked (11)

Other Newsletter Articles - Manufacturing
Other Newsletter Articles - ManufacturingOther Newsletter Articles - Manufacturing
Other Newsletter Articles - Manufacturing
 
Big data vs datawarehousing
Big data vs datawarehousingBig data vs datawarehousing
Big data vs datawarehousing
 
BlueVia SDK for .NET Overview
BlueVia SDK for .NET OverviewBlueVia SDK for .NET Overview
BlueVia SDK for .NET Overview
 
AFR_TS_Catalog
AFR_TS_CatalogAFR_TS_Catalog
AFR_TS_Catalog
 
Inside Wijmo 5, a Large-scale JavaScript Product
Inside Wijmo 5, a Large-scale JavaScript ProductInside Wijmo 5, a Large-scale JavaScript Product
Inside Wijmo 5, a Large-scale JavaScript Product
 
Joseph Inbaraj S 11+ years ALM Admin Resume
Joseph Inbaraj S 11+ years ALM Admin ResumeJoseph Inbaraj S 11+ years ALM Admin Resume
Joseph Inbaraj S 11+ years ALM Admin Resume
 
Cryptography
CryptographyCryptography
Cryptography
 
AngularJS Services
AngularJS ServicesAngularJS Services
AngularJS Services
 
DSpace UI Prototype Challenge: Spring Boot + Thymeleaf
DSpace UI Prototype Challenge: Spring Boot + ThymeleafDSpace UI Prototype Challenge: Spring Boot + Thymeleaf
DSpace UI Prototype Challenge: Spring Boot + Thymeleaf
 
Business Plan: Photography Business
Business Plan: Photography Business Business Plan: Photography Business
Business Plan: Photography Business
 
Introduction to Network Security
Introduction to Network SecurityIntroduction to Network Security
Introduction to Network Security
 

Similar to AngularJs Workshop SDP December 28th 2014

introduction to Angularjs basics
introduction to Angularjs basicsintroduction to Angularjs basics
introduction to Angularjs basics
Ravindra K
 
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJSAngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
murtazahaveliwala
 
Introduction to single page application with angular js
Introduction to single page application with angular jsIntroduction to single page application with angular js
Introduction to single page application with angular js
Mindfire Solutions
 
Angular Presentation
Angular PresentationAngular Presentation
Angular Presentation
Adam Moore
 
Angular js
Angular jsAngular js
Angular js
Baldeep Sohal
 
AngularJS in 60ish Minutes
AngularJS in 60ish MinutesAngularJS in 60ish Minutes
AngularJS in 60ish Minutes
Dan Wahlin
 
AngularJS
AngularJSAngularJS
Angularjs Basics
Angularjs BasicsAngularjs Basics
Angularjs Basics
Anuradha Bandara
 
Leveling up with AngularJS
Leveling up with AngularJSLeveling up with AngularJS
Leveling up with AngularJS
Austin Condiff
 
MVC Training Part 2
MVC Training Part 2MVC Training Part 2
MVC Training Part 2
Lee Englestone
 
Angular
AngularAngular
Angular
LearningTech
 
Angular
AngularAngular
Angular
LearningTech
 
Angular Directives
Angular DirectivesAngular Directives
Angular Directives
Malla Reddy University
 
Introduction to Angularjs : kishan kumar
Introduction to Angularjs : kishan kumarIntroduction to Angularjs : kishan kumar
Introduction to Angularjs : kishan kumar
Appfinz Technologies
 
Angular js
Angular jsAngular js
Angular js
vu van quyet
 
mean stack
mean stackmean stack
mean stack
michaelaaron25322
 
AngularJs Crash Course
AngularJs Crash CourseAngularJs Crash Course
AngularJs Crash Course
Keith Bloomfield
 
AngularJS Workshop
AngularJS WorkshopAngularJS Workshop
AngularJS Workshop
Gianluca Cacace
 
Angular Framework ppt for beginners and advanced
Angular Framework ppt for beginners and advancedAngular Framework ppt for beginners and advanced
Angular Framework ppt for beginners and advanced
Preetha Ganapathi
 
Introduction to Angular Js
Introduction to Angular JsIntroduction to Angular Js
Introduction to Angular Js
Professional Guru
 

Similar to AngularJs Workshop SDP December 28th 2014 (20)

introduction to Angularjs basics
introduction to Angularjs basicsintroduction to Angularjs basics
introduction to Angularjs basics
 
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJSAngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
 
Introduction to single page application with angular js
Introduction to single page application with angular jsIntroduction to single page application with angular js
Introduction to single page application with angular js
 
Angular Presentation
Angular PresentationAngular Presentation
Angular Presentation
 
Angular js
Angular jsAngular js
Angular js
 
AngularJS in 60ish Minutes
AngularJS in 60ish MinutesAngularJS in 60ish Minutes
AngularJS in 60ish Minutes
 
AngularJS
AngularJSAngularJS
AngularJS
 
Angularjs Basics
Angularjs BasicsAngularjs Basics
Angularjs Basics
 
Leveling up with AngularJS
Leveling up with AngularJSLeveling up with AngularJS
Leveling up with AngularJS
 
MVC Training Part 2
MVC Training Part 2MVC Training Part 2
MVC Training Part 2
 
Angular
AngularAngular
Angular
 
Angular
AngularAngular
Angular
 
Angular Directives
Angular DirectivesAngular Directives
Angular Directives
 
Introduction to Angularjs : kishan kumar
Introduction to Angularjs : kishan kumarIntroduction to Angularjs : kishan kumar
Introduction to Angularjs : kishan kumar
 
Angular js
Angular jsAngular js
Angular js
 
mean stack
mean stackmean stack
mean stack
 
AngularJs Crash Course
AngularJs Crash CourseAngularJs Crash Course
AngularJs Crash Course
 
AngularJS Workshop
AngularJS WorkshopAngularJS Workshop
AngularJS Workshop
 
Angular Framework ppt for beginners and advanced
Angular Framework ppt for beginners and advancedAngular Framework ppt for beginners and advanced
Angular Framework ppt for beginners and advanced
 
Introduction to Angular Js
Introduction to Angular JsIntroduction to Angular Js
Introduction to Angular Js
 

More from Ran Wahle

MicroFrontend With Iframes, dirty laundry that can be cleaned
MicroFrontend With Iframes, dirty laundry that can be cleanedMicroFrontend With Iframes, dirty laundry that can be cleaned
MicroFrontend With Iframes, dirty laundry that can be cleaned
Ran Wahle
 
Into React-DOM.pptx
Into React-DOM.pptxInto React-DOM.pptx
Into React-DOM.pptx
Ran Wahle
 
Lets go to the background
Lets go to the backgroundLets go to the background
Lets go to the background
Ran Wahle
 
Permissions api
Permissions apiPermissions api
Permissions api
Ran Wahle
 
Lets go vanilla
Lets go vanillaLets go vanilla
Lets go vanilla
Ran Wahle
 
Custom elements
Custom elements Custom elements
Custom elements
Ran Wahle
 
Web workers
Web workers Web workers
Web workers
Ran Wahle
 
Using legacy code with micro frontends
Using legacy code with micro frontendsUsing legacy code with micro frontends
Using legacy code with micro frontends
Ran Wahle
 
Ngrx one-effect
Ngrx one-effectNgrx one-effect
Ngrx one-effect
Ran Wahle
 
Angular migration
Angular migrationAngular migration
Angular migration
Ran Wahle
 
Javascript async / await Frontend-IL
Javascript async / await Frontend-ILJavascript async / await Frontend-IL
Javascript async / await Frontend-IL
Ran Wahle
 
Boost js state management
Boost js state managementBoost js state management
Boost js state management
Ran Wahle
 
Angular 2.0 change detection
Angular 2.0 change detectionAngular 2.0 change detection
Angular 2.0 change detection
Ran Wahle
 
Code migration from Angular 1.x to Angular 2.0
Code migration from Angular 1.x to Angular 2.0Code migration from Angular 1.x to Angular 2.0
Code migration from Angular 1.x to Angular 2.0
Ran Wahle
 
Async patterns in javascript
Async patterns in javascriptAsync patterns in javascript
Async patterns in javascript
Ran Wahle
 
Angular js 2
Angular js 2Angular js 2
Angular js 2
Ran Wahle
 
Asyncawait in typescript
Asyncawait in typescriptAsyncawait in typescript
Asyncawait in typescript
Ran Wahle
 
Angular%201%20to%20angular%202
Angular%201%20to%20angular%202Angular%201%20to%20angular%202
Angular%201%20to%20angular%202
Ran Wahle
 
What’s new in angular 2 - From FrontEnd IL Meetup
What’s new in angular 2 - From FrontEnd IL MeetupWhat’s new in angular 2 - From FrontEnd IL Meetup
What’s new in angular 2 - From FrontEnd IL Meetup
Ran Wahle
 
What’s new in angular 2
What’s new in angular 2What’s new in angular 2
What’s new in angular 2
Ran Wahle
 

More from Ran Wahle (20)

MicroFrontend With Iframes, dirty laundry that can be cleaned
MicroFrontend With Iframes, dirty laundry that can be cleanedMicroFrontend With Iframes, dirty laundry that can be cleaned
MicroFrontend With Iframes, dirty laundry that can be cleaned
 
Into React-DOM.pptx
Into React-DOM.pptxInto React-DOM.pptx
Into React-DOM.pptx
 
Lets go to the background
Lets go to the backgroundLets go to the background
Lets go to the background
 
Permissions api
Permissions apiPermissions api
Permissions api
 
Lets go vanilla
Lets go vanillaLets go vanilla
Lets go vanilla
 
Custom elements
Custom elements Custom elements
Custom elements
 
Web workers
Web workers Web workers
Web workers
 
Using legacy code with micro frontends
Using legacy code with micro frontendsUsing legacy code with micro frontends
Using legacy code with micro frontends
 
Ngrx one-effect
Ngrx one-effectNgrx one-effect
Ngrx one-effect
 
Angular migration
Angular migrationAngular migration
Angular migration
 
Javascript async / await Frontend-IL
Javascript async / await Frontend-ILJavascript async / await Frontend-IL
Javascript async / await Frontend-IL
 
Boost js state management
Boost js state managementBoost js state management
Boost js state management
 
Angular 2.0 change detection
Angular 2.0 change detectionAngular 2.0 change detection
Angular 2.0 change detection
 
Code migration from Angular 1.x to Angular 2.0
Code migration from Angular 1.x to Angular 2.0Code migration from Angular 1.x to Angular 2.0
Code migration from Angular 1.x to Angular 2.0
 
Async patterns in javascript
Async patterns in javascriptAsync patterns in javascript
Async patterns in javascript
 
Angular js 2
Angular js 2Angular js 2
Angular js 2
 
Asyncawait in typescript
Asyncawait in typescriptAsyncawait in typescript
Asyncawait in typescript
 
Angular%201%20to%20angular%202
Angular%201%20to%20angular%202Angular%201%20to%20angular%202
Angular%201%20to%20angular%202
 
What’s new in angular 2 - From FrontEnd IL Meetup
What’s new in angular 2 - From FrontEnd IL MeetupWhat’s new in angular 2 - From FrontEnd IL Meetup
What’s new in angular 2 - From FrontEnd IL Meetup
 
What’s new in angular 2
What’s new in angular 2What’s new in angular 2
What’s new in angular 2
 

Recently uploaded

Folding Cheat Sheet #7 - seventh in a series
Folding Cheat Sheet #7 - seventh in a seriesFolding Cheat Sheet #7 - seventh in a series
Folding Cheat Sheet #7 - seventh in a series
Philip Schwarz
 
Cisco Live Announcements: New ThousandEyes Release Highlights - July 2024
Cisco Live Announcements: New ThousandEyes Release Highlights - July 2024Cisco Live Announcements: New ThousandEyes Release Highlights - July 2024
Cisco Live Announcements: New ThousandEyes Release Highlights - July 2024
ThousandEyes
 
Seamless PostgreSQL to Snowflake Data Transfer in 8 Simple Steps
Seamless PostgreSQL to Snowflake Data Transfer in 8 Simple StepsSeamless PostgreSQL to Snowflake Data Transfer in 8 Simple Steps
Seamless PostgreSQL to Snowflake Data Transfer in 8 Simple Steps
Estuary Flow
 
ENISA Threat Landscape 2023 documentation
ENISA Threat Landscape 2023 documentationENISA Threat Landscape 2023 documentation
ENISA Threat Landscape 2023 documentation
sofiafernandezon
 
A Comparative Analysis of Functional and Non-Functional Testing.pdf
A Comparative Analysis of Functional and Non-Functional Testing.pdfA Comparative Analysis of Functional and Non-Functional Testing.pdf
A Comparative Analysis of Functional and Non-Functional Testing.pdf
kalichargn70th171
 
Abortion pills in Fujairah *((+971588192166*)☎️)¥) **Effective Abortion Pills...
Abortion pills in Fujairah *((+971588192166*)☎️)¥) **Effective Abortion Pills...Abortion pills in Fujairah *((+971588192166*)☎️)¥) **Effective Abortion Pills...
Abortion pills in Fujairah *((+971588192166*)☎️)¥) **Effective Abortion Pills...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
COMPSAC 2024 D&I Panel: Charting a Course for Equity: Strategies for Overcomi...
COMPSAC 2024 D&I Panel: Charting a Course for Equity: Strategies for Overcomi...COMPSAC 2024 D&I Panel: Charting a Course for Equity: Strategies for Overcomi...
COMPSAC 2024 D&I Panel: Charting a Course for Equity: Strategies for Overcomi...
Hironori Washizaki
 
Development of Chatbot Using AI\ML Technologies
Development of Chatbot Using AI\ML TechnologiesDevelopment of Chatbot Using AI\ML Technologies
Development of Chatbot Using AI\ML Technologies
MaisnamLuwangPibarel
 
BITCOIN HEIST RANSOMEWARE ATTACK PREDICTION
BITCOIN HEIST RANSOMEWARE ATTACK PREDICTIONBITCOIN HEIST RANSOMEWARE ATTACK PREDICTION
BITCOIN HEIST RANSOMEWARE ATTACK PREDICTION
ssuser2b426d1
 
FAST Channels: Explosive Growth Forecast 2024-2027 (Buckle Up!)
FAST Channels: Explosive Growth Forecast 2024-2027 (Buckle Up!)FAST Channels: Explosive Growth Forecast 2024-2027 (Buckle Up!)
FAST Channels: Explosive Growth Forecast 2024-2027 (Buckle Up!)
Roshan Dwivedi
 
Wired_2.0_Create_AmsterdamJUG_09072024.pptx
Wired_2.0_Create_AmsterdamJUG_09072024.pptxWired_2.0_Create_AmsterdamJUG_09072024.pptx
Wired_2.0_Create_AmsterdamJUG_09072024.pptx
SimonedeGijt
 
Shivam Pandit working on Php Web Developer.
Shivam Pandit working on Php Web Developer.Shivam Pandit working on Php Web Developer.
Shivam Pandit working on Php Web Developer.
shivamt017
 
Google ML-Kit - Understanding on-device machine learning
Google ML-Kit - Understanding on-device machine learningGoogle ML-Kit - Understanding on-device machine learning
Google ML-Kit - Understanding on-device machine learning
VishrutGoyani1
 
Intro to Amazon Web Services (AWS) and Gen AI
Intro to Amazon Web Services (AWS) and Gen AIIntro to Amazon Web Services (AWS) and Gen AI
Intro to Amazon Web Services (AWS) and Gen AI
Ortus Solutions, Corp
 
AWS Cloud Practitioner Essentials (Second Edition) (Arabic) AWS Security .pdf
AWS Cloud Practitioner Essentials (Second Edition) (Arabic) AWS Security .pdfAWS Cloud Practitioner Essentials (Second Edition) (Arabic) AWS Security .pdf
AWS Cloud Practitioner Essentials (Second Edition) (Arabic) AWS Security .pdf
karim wahed
 
ANSYS Mechanical APDL Introductory Tutorials.pdf
ANSYS Mechanical APDL Introductory Tutorials.pdfANSYS Mechanical APDL Introductory Tutorials.pdf
ANSYS Mechanical APDL Introductory Tutorials.pdf
sachin chaurasia
 
dachnug51 - All you ever wanted to know about domino licensing.pdf
dachnug51 - All you ever wanted to know about domino licensing.pdfdachnug51 - All you ever wanted to know about domino licensing.pdf
dachnug51 - All you ever wanted to know about domino licensing.pdf
DNUG e.V.
 
introduction of Ansys software and basic and advance knowledge of modelling s...
introduction of Ansys software and basic and advance knowledge of modelling s...introduction of Ansys software and basic and advance knowledge of modelling s...
introduction of Ansys software and basic and advance knowledge of modelling s...
sachin chaurasia
 
AWS Cloud Practitioner Essentials (Second Edition) (Arabic) Course Introducti...
AWS Cloud Practitioner Essentials (Second Edition) (Arabic) Course Introducti...AWS Cloud Practitioner Essentials (Second Edition) (Arabic) Course Introducti...
AWS Cloud Practitioner Essentials (Second Edition) (Arabic) Course Introducti...
karim wahed
 
Software development... for all? (keynote at ICSOFT'2024)
Software development... for all? (keynote at ICSOFT'2024)Software development... for all? (keynote at ICSOFT'2024)
Software development... for all? (keynote at ICSOFT'2024)
miso_uam
 

Recently uploaded (20)

Folding Cheat Sheet #7 - seventh in a series
Folding Cheat Sheet #7 - seventh in a seriesFolding Cheat Sheet #7 - seventh in a series
Folding Cheat Sheet #7 - seventh in a series
 
Cisco Live Announcements: New ThousandEyes Release Highlights - July 2024
Cisco Live Announcements: New ThousandEyes Release Highlights - July 2024Cisco Live Announcements: New ThousandEyes Release Highlights - July 2024
Cisco Live Announcements: New ThousandEyes Release Highlights - July 2024
 
Seamless PostgreSQL to Snowflake Data Transfer in 8 Simple Steps
Seamless PostgreSQL to Snowflake Data Transfer in 8 Simple StepsSeamless PostgreSQL to Snowflake Data Transfer in 8 Simple Steps
Seamless PostgreSQL to Snowflake Data Transfer in 8 Simple Steps
 
ENISA Threat Landscape 2023 documentation
ENISA Threat Landscape 2023 documentationENISA Threat Landscape 2023 documentation
ENISA Threat Landscape 2023 documentation
 
A Comparative Analysis of Functional and Non-Functional Testing.pdf
A Comparative Analysis of Functional and Non-Functional Testing.pdfA Comparative Analysis of Functional and Non-Functional Testing.pdf
A Comparative Analysis of Functional and Non-Functional Testing.pdf
 
Abortion pills in Fujairah *((+971588192166*)☎️)¥) **Effective Abortion Pills...
Abortion pills in Fujairah *((+971588192166*)☎️)¥) **Effective Abortion Pills...Abortion pills in Fujairah *((+971588192166*)☎️)¥) **Effective Abortion Pills...
Abortion pills in Fujairah *((+971588192166*)☎️)¥) **Effective Abortion Pills...
 
COMPSAC 2024 D&I Panel: Charting a Course for Equity: Strategies for Overcomi...
COMPSAC 2024 D&I Panel: Charting a Course for Equity: Strategies for Overcomi...COMPSAC 2024 D&I Panel: Charting a Course for Equity: Strategies for Overcomi...
COMPSAC 2024 D&I Panel: Charting a Course for Equity: Strategies for Overcomi...
 
Development of Chatbot Using AI\ML Technologies
Development of Chatbot Using AI\ML TechnologiesDevelopment of Chatbot Using AI\ML Technologies
Development of Chatbot Using AI\ML Technologies
 
BITCOIN HEIST RANSOMEWARE ATTACK PREDICTION
BITCOIN HEIST RANSOMEWARE ATTACK PREDICTIONBITCOIN HEIST RANSOMEWARE ATTACK PREDICTION
BITCOIN HEIST RANSOMEWARE ATTACK PREDICTION
 
FAST Channels: Explosive Growth Forecast 2024-2027 (Buckle Up!)
FAST Channels: Explosive Growth Forecast 2024-2027 (Buckle Up!)FAST Channels: Explosive Growth Forecast 2024-2027 (Buckle Up!)
FAST Channels: Explosive Growth Forecast 2024-2027 (Buckle Up!)
 
Wired_2.0_Create_AmsterdamJUG_09072024.pptx
Wired_2.0_Create_AmsterdamJUG_09072024.pptxWired_2.0_Create_AmsterdamJUG_09072024.pptx
Wired_2.0_Create_AmsterdamJUG_09072024.pptx
 
Shivam Pandit working on Php Web Developer.
Shivam Pandit working on Php Web Developer.Shivam Pandit working on Php Web Developer.
Shivam Pandit working on Php Web Developer.
 
Google ML-Kit - Understanding on-device machine learning
Google ML-Kit - Understanding on-device machine learningGoogle ML-Kit - Understanding on-device machine learning
Google ML-Kit - Understanding on-device machine learning
 
Intro to Amazon Web Services (AWS) and Gen AI
Intro to Amazon Web Services (AWS) and Gen AIIntro to Amazon Web Services (AWS) and Gen AI
Intro to Amazon Web Services (AWS) and Gen AI
 
AWS Cloud Practitioner Essentials (Second Edition) (Arabic) AWS Security .pdf
AWS Cloud Practitioner Essentials (Second Edition) (Arabic) AWS Security .pdfAWS Cloud Practitioner Essentials (Second Edition) (Arabic) AWS Security .pdf
AWS Cloud Practitioner Essentials (Second Edition) (Arabic) AWS Security .pdf
 
ANSYS Mechanical APDL Introductory Tutorials.pdf
ANSYS Mechanical APDL Introductory Tutorials.pdfANSYS Mechanical APDL Introductory Tutorials.pdf
ANSYS Mechanical APDL Introductory Tutorials.pdf
 
dachnug51 - All you ever wanted to know about domino licensing.pdf
dachnug51 - All you ever wanted to know about domino licensing.pdfdachnug51 - All you ever wanted to know about domino licensing.pdf
dachnug51 - All you ever wanted to know about domino licensing.pdf
 
introduction of Ansys software and basic and advance knowledge of modelling s...
introduction of Ansys software and basic and advance knowledge of modelling s...introduction of Ansys software and basic and advance knowledge of modelling s...
introduction of Ansys software and basic and advance knowledge of modelling s...
 
AWS Cloud Practitioner Essentials (Second Edition) (Arabic) Course Introducti...
AWS Cloud Practitioner Essentials (Second Edition) (Arabic) Course Introducti...AWS Cloud Practitioner Essentials (Second Edition) (Arabic) Course Introducti...
AWS Cloud Practitioner Essentials (Second Edition) (Arabic) Course Introducti...
 
Software development... for all? (keynote at ICSOFT'2024)
Software development... for all? (keynote at ICSOFT'2024)Software development... for all? (keynote at ICSOFT'2024)
Software development... for all? (keynote at ICSOFT'2024)
 

AngularJs Workshop SDP December 28th 2014

  • 1. © Copyright SELA Software & Education Labs, Ltd. | 14-18 Baruch Hirsch St., Bnei Brak, 51202 Israel | www.selagroup.com SELA DEVELOPER PRACTICE December 28th – January 1st, 2014 Ran Wahle AngularJS – from 0 to 60
  • 2. Agenda Introduction Modules and dependency injection Data binding, controllers and scopes Services Filters Directives Form validation Routing
  • 3. The Modern Web From web pages to web applications More and more logic is pushed to the client
  • 4. The Problem As we add more and more JavaScript, our application is getting:
  • 6. What Is AngularJS? An MV* framework for developing CRUD style web applications Developed by Google Works on all modern web browsers Open source (MIT license) No external dependencies Very opinionated
  • 8. Angular Building Blocks Module Module Module Scope Controller ServiceTemplate Filter Directive Two-Way Binding Dependency Injection Routing
  • 9. <!doctype html> <html data-ng-app> <head> </head> <body> <input type="text" data-ng-model="name" /> {{name}} </body> </html> Your first AngularJS page
  • 10. Module Divide application into small pieces Can contain controllers, services, directives, etc. Can depend on other modules Other modules can depend on it
  • 11. //Creating a module angular.module('yourModuleName', [ /*…dependencies…*/ ]); //Accessing a module angular.module('yourModuleName'); //Note: no dependencies array Creating a module
  • 12. Dependency Injection Each angular application has an $injector service Components are injected by the $injector There are several options for using dependency injection
  • 13. One option removes the responsibility of locating the dependency from the component. The dependency is simply handed to the component. In Angular each application has an injector that is responsible for construction and lookup of dependencies function SomeClass(greeter) { this.greeter = greeter; } SomeClass.prototype.doSomething = function(name) { this.greeter.greet(name); } Dependency Injection cont.
  • 14. Creating a component angular.module('yourModuleName').service('serviceName', function() { //service’s code }); Creating an Angular component Consuming the component angular.module('yourModuleName') .controller('controllerName', ['serviceName', function(serviceName) { //controller’s code });
  • 15. © Copyright SELA software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com Data binding Controllers, scopes and views
  • 16. AngularJS supports MV *- patterns Views HTML templates Controllers JavaScript functions Data Model $scope
  • 17. HTML templates An HTML element with Angular-related attributes Declarative Contains Angular-specific elements and attributes Contains expressions evaluated against scope properties
  • 18. <html> <head> </head> <body data-ng-app="myAppName"> <div data-ng-controller="myController"> <input data-ng-model="name" /> <button data-ng-click="greet()">Greet</button> </div> </body> </html> HTML template
  • 19. Controller A JavaScript constructor function Contains view related logic Can get and set data on the $scope Shouldn’t have any DOM related functionality Sets up the $scope initial state Associated with a template via the ng-controller directive
  • 20. angular.module('myAppName') .controller('myController', ['$scope', function($scope) { var greet = function() { alert('Hello ' + $scope.name); }; $scope.greet = greet; }]); Controller
  • 21. $scope The glue between the HTML template and the controller Hierarchical in the same way as HTML Hierarchy implemented using JavaScript prototypes The root scope is represented by the $rootScope service
  • 23. Services Reusable singleton objects Can be injected into controllers, filters, directives and other services Created only when needed There are many built-in services in AngularJS
  • 24. angular.module('myApp') .service('myService', [/*…dependencies…*/, function(/*…dependencies…*/) { //service logic here this.someMethod = function() {}; }]); angular.module('myApp') .controller('myController', ['myService', function(myService) { myService.someMetho(); }]); Creating and using a service
  • 27. Ajax using $http $http service is a built-in service in AngularJS Used for communicating with the server Wraps XMLHttpRequest Automatically serializes/deserializes JSON Supports request and response transformation Supports request and response interception
  • 28. $http.get('url') .success(function(response) { //handle the server's response }) .error(function(errorResponse) { //handle the server's error response }); $http.post('url', requestBody); $http.put('url', requestBody); $http.delete('url', requestBody); Using $http
  • 29. $http({ url: 'url', method: 'get', //or 'put', 'post', 'delete' params: {…}, //for get requests data: {…}, //for put or post requests }).success(…).error(…).finally(…); Using $http (Cont)
  • 30. The $resource Service An abstraction on top of the $http service for interaction with RESTful web services Depends on the ngResource module and requires the inclusion of the angular-resource.js script Receives a parameterized URL, with optional default values Returns an object with convenient methods (get, query, $save, $delete, …) Custom actions can be configured as well
  • 31. Using the $resource service angular.module('resourceDemo', ['ngResource']) .controller('questionsCtrl', function($scope) { var baseUrl = '/api/v1.0/questions/:id'; var Questions = $resource(baseUrl, {id: '@id'}); $scope.loadQuestions = function() { $scope.questions = Questions.query(); }; $scope.removeQuestion = function(question) { question.$remove(); }; });
  • 33. Filters Formats the value of an expression for display to the user {{ expression | filter }} {{ 10 | currency }} will display 10$ May have arguments {{ price | number:2 }} Chainable
  • 34. angular.module('myModule') .filter('digitToText', function() { var digitToText = [ 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine' ]; return function(digit) { return digitToText[digit]; }; }); Create a custom filter
  • 36. The form directive Aggregates the state of all its input elements Sets CSS classes according to the state The default form action is automatically ignored Available to the scope as a property with the name of the form Contained input elements are also available by their names, as sub- properties of the form property
  • 37. The form directive Creates a formController The formController aggregates the state of all form controls The formController is available to the current scope by its name To submit the form using Ajax, respond to ng-submit or ng-click
  • 38. Built-in validation directives Angular provides the following validation directives: required – Checks that the field has a value min – Checks that the field value is greater than the given value max – Checks that the field value is lower than the given value minlength – Checks that the field value is longer than the given value maxlength – Checks that the field value is shorter than the given value pattern – Checks that the field value matches the given regular expression All of the above directives set a validation error identified by their name when the condition is not met
  • 39. The ngModel directive Provides a two way data binding between the input element and the model Provides automatic validation for common HTML5 input types (checkbox, email, number, text, url) Tracks the control’s state Sets CSS classes according to the state
  • 40. Note the usage of the novalidate attribute to disable the browser’s built-in validation <form name="form" novalidate> <div> <input type="text" name="title" ng-model="question.title" required /> </div> <div> <textarea name="content" ng-model="question.content" required> </textarea> </div> <button ng-click="addQuestion(question)”> Submit </button> </form> Using the form and ngModel directives
  • 42. Directives Custom HTML elements, attributes, classes and comments that are recognized by Angular Essentially extend the existing HTML vocabulary Creating new elements Adding behavior to existing elements Most of the things we’ve seen so far are built-in directives (ng-app, ng-controller, ng-repeat, ng- model, required, …)
  • 43. Creating custom directives Directives are registered on modules, with the module.directive function, which takes the directive name and a factory function The factory function should return a directive definition object (discussed in the following slides) It’s a best practice to prefix custom directives to prevent collision with other 3rd party directives, or a future standard
  • 44. The following code demonstrates the definition of a new directive, named myDirective Note that this is a only a skeleton with an empty directive definition object. We’ll fill this object with properties in the following slides. myModule.directive('myDirective', function() { return { }; }); Creating a custom directive
  • 45. Create a custom directive The object retuned can have the following properties: • link: a function that is called during the linking phase • template: an HTML template for the directive • templateUrl: a rooted path to an HTML template file • require: specifies a dependency on another directive • transclude: determines whether child elements should be included in the template • controller: used to share behavior and communicate with other directives
  • 47. Routing in Single Page Applications Unlike traditional web sites, in SPAs, the responsibility for rendering the view is on the client side We do, however, want to give the user the same features they are used to, such as: The browser’s navigation buttons The address bar for navigation The ability to bookmark specific pages How can we change the address bar without causing the browser to issue a new request?
  • 48. The $location service An abstraction on top of the window.location object Synchronized with the browser address bar and allows to watch or manipulate the URL Seamless integration with the HTML5 History API. Links are automatically rewritten to reflect the supported mode. <a href="/page1?id=123">link</a> /index.html#/page1?id=123 /page1?id=123
  • 49. The ui.router module Angular comes with a built-in router named ngRoute But most projects use the 3rd party AngularUI Router The AngularUI Router is packaged in its own module, named ui.router To use the router, perform the following steps: Install and reference the angular-ui-router.js script in the HTML Add the ui.router module as a dependency to your module
  • 50. Routes are registered in the module’s config function, by calling the $stateProvider.state method with a state name and a route object A default route can be registered with the $routeProvider.otherwise method The contents of the route object are discussed in the following slides myModule.config(function($stateProvider) { $stateProvider("page1", {url: '/page1', …}) .state("page2", {…}) .state("page3", {…}) }); Route registration
  • 51. The 3rd party uiView directive marks the place in which the new route’s template should be rendered Can be used as an element, or as an attribute on any element <body ng-app="myModule"> <div> <ul> <li><a ui-sref="page1">Page 1</a></li> <li><a ui-sref="page2">Page 2</a></li> </ul> </div> <div ui-view /> </body> The uiView directive
  • 53. Modules and dependency injection Data binding, controllers and scopes Services Filters Form validation Directives Routing Email: ranw@sela.co.il Summary