SlideShare a Scribd company logo
AngularJS workshop
University of Latvia
15.02.2016
Agenda
AngularJS core principles
Building a sample web site to demonstrate how AngularJS works
(from the scratch)
Some words about AngularJS 2
Practical tasks (if there is time and energy)
Youth Techclub
Youth Techclub brings together young people that are interested in
building their skills in information technology by sharing knowledge
and exploring.
Wide variety of people – coders, graphic designers, idea generators..
Workshops, meet-up’s, external speakers.
Apply via official Facebook page (search for «Youth Techclub»)
Youth Techclub next semester
Azure Web Apps (from Dreamspark students)
Web development:
- HTML5/CSS3
- Javascript
- jQuery
- Angular, Angular 2.0
ASP.NET:
- MVC
- Web API
GitHub:
- Git usage
Mobile app development:
- Xamarin (cross platform development)
Unit testing
Test driven development
Agile principles
ASO (app store optimization)
Me
Studying Masters in RTU
Youth Techclub founder
Microsoft Student partner
Student fraternity Latvia
Cyber-unit
Lets clear some things…
There are things that are hard to translate to Latvian
Workshop is an introduction to AngularJS
I’m only one so I won’t be able to help you all
Demo gods can be cruel some times if you have not offered a tribute
for some time 
Some tools we will use
NodeJS – server-side JavaScript runtime
Bower package manager – handles getting client side packages in
web development
Node package manager – handles getting server side packages in
web development
Bootstrap – UI framework to help with responsive web sites
NodeJS
Install from https://nodejs.org/en/
You can use both the mature and the latest version
Visual Studio comes with built-in NodeJS support, but the version is
not the latest
Bower
In command line execute – npm install –g bower
Navigate to solution and execute - bower init
bower.json file is created, it will contain the list of packages installed
Lets get to the business …
What is AngularJS and why it is popular?
Open-source web application framework maintained by Google
Addresses challenges encountered in developing single-page
applications
Decoupling and dependency injection
Makes testing very easy and code modular
Lets understand how AngularJS works
AngularJS application –
defined by ng-app attribute in
HTML, creates $rootScope
Modules – logically splits
application
Views – renders HTML to user
Controller – manipulates data
and business logic
More complete picture
Config – you can configure different
aspects of modules – routing,
dependencies, HTTP request handling
and lot more
Routes – defines URL for modules
$scope – local $scope for controller,
shared with view
Directives – markers in DOM that instruct
Angular to attach specified behaviour to
DOM element
Service – encapsulates common logic
Lets prepare solution
1. Create index.html file
2. Create folders «app» and «assets»
3. Create folder «libs» in «assets»
4. Init bower (or add through VS)
5. Copy required libraries to libs folder
6. Add libraries in index.html
Lets create AngularJS Hello world!
1. Create ng-app tag in HTML
2. Create div element and attach controller to it
3. Create app.module.js in «app» folder
4. Define common module, myApp module and a controller
5. Test scoped variables
Directives
Directive defined in code must match the directive in HTML markup.
4 ways to define in markup:
<my-dir></my-dir>
<span my-dir=«exp»></span>
<!– directive; my-dir exp -->
<span class=«my-dir: exp;»></span>
‘Restrict’ option defines how to match code with markup
Lets create a header navigation directive
Some popular built-in directives
ngModel – binds input to model
value
ngClick – specify behaviour when
element is clicked
ngChange – evaluates
expressions when input changes
ngRepeat – instantiates template
once per item from a collection
ngMaxlength – specifies max
length for input
ngIf – adds/removes DOM
element based on expression
ngShow – shows/hides DOM
element based on expression
ngRequired – adds required
validator to input field
Views
DOM elements after Angular is compiled
Allows to work with components
Handles interaction with user and displaying the state
Controller
Responsible for constructing the model for a view to interact with
Use controller to manipulate data in the scope.
Routing
You can add routing as a dependency
Turns our application in state machine
ngRoute vs ui-router
Promises
A service that helps to run functions asynchronously and use their
return values when they are done processing.
ES6 style or deffered objects style
Promise chaining
Demo tasks
1. Add routing with ui-router
2. Create header as a directive
3. Create table with source data from service
4. Create a form to send data to service
5. Add custom validations to form
AngularJS 2.0
Complete rewrite, not compatible with previous versions
Written in TypeScript
Some changes - faster, new router, no controllers, no $scope,
different types of directives,
More examples
https://github.com/simpulton/noterious
https://www.madewithangular.com/#/
https://builtwith.angularjs.org/
Tasks
1. Add more validations to form (pattern, max number, etc.)
2. Add .gif loading symbol while GET/POST is executing
3. Enable form button if all fields are filled and form is valid
4. Any other suggestions from your side?
Thank you!
Your feedback is welcomed! 

More Related Content

PPTX
Single Page Applications in SharePoint with Angular
PPTX
Angularjs PPT
PDF
Angular.js - JS Camp UKraine 2013
PPT
Angularjs for kolkata drupal meetup
PPTX
OCTO BOF - How to build Netvibes with AngularJS
PPTX
Introduction to AngularJS Framework
PDF
Gettings started with the superheroic JavaScript library AngularJS
Single Page Applications in SharePoint with Angular
Angularjs PPT
Angular.js - JS Camp UKraine 2013
Angularjs for kolkata drupal meetup
OCTO BOF - How to build Netvibes with AngularJS
Introduction to AngularJS Framework
Gettings started with the superheroic JavaScript library AngularJS

What's hot (20)

PPTX
Modules in AngularJs
PDF
PPTX
AngularJS One Day Workshop
PPTX
Angular js tutorial slides
PPTX
Step by Step - AngularJS
PPTX
What's new in Angular 2?
PPTX
Overview about AngularJS Framework
PDF
Introduction to AngularJS
PPTX
AngularJS is awesome
PDF
Angular js - 10 reasons to choose angularjs
PPTX
AngularJS = Browser applications on steroids
PDF
Angularjs tutorial
PPTX
Angular js
PPTX
Building share point apps with angularjs
PPTX
Introduction of ASP.NET MVC and AngularJS
PDF
Angular 2 overview
PPTX
Angular vs React: Building modern SharePoint interfaces with SPFx
PPTX
AngularJS Beginners Workshop
PPTX
Demand driven applications with om.next and react native
PPTX
Javascript Frameworks Comparison - Angular, Knockout, Ember and Backbone
Modules in AngularJs
AngularJS One Day Workshop
Angular js tutorial slides
Step by Step - AngularJS
What's new in Angular 2?
Overview about AngularJS Framework
Introduction to AngularJS
AngularJS is awesome
Angular js - 10 reasons to choose angularjs
AngularJS = Browser applications on steroids
Angularjs tutorial
Angular js
Building share point apps with angularjs
Introduction of ASP.NET MVC and AngularJS
Angular 2 overview
Angular vs React: Building modern SharePoint interfaces with SPFx
AngularJS Beginners Workshop
Demand driven applications with om.next and react native
Javascript Frameworks Comparison - Angular, Knockout, Ember and Backbone
Ad

Similar to Angular js workshop (20)

PDF
[Ebooks PDF] download AngularJS 1st Edition Brad Green full chapters
PPTX
Learning AngularJS - Complete coverage of AngularJS features and concepts
PPTX
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
PPTX
ME vs WEB - AngularJS Fundamentals
PPTX
Angular js for Beginnners
PDF
Getting Started With AngularJS
PDF
AngularJS for Beginners
PPTX
Angular Presentation
PDF
Getting Started with AngularJS
PDF
Angular js gtg-27feb2013
PDF
AngularJS Curriculum-Zeolearn
PPTX
Angular training - Day 3 - custom directives, $http, $resource, setup with ye...
PPT
Introduction to AngularJS
PPTX
Intro to AngularJs
DOCX
angularjs_tutorial.docx
PPTX
Angularjs basic part01
PPTX
Practical AngularJS
PPTX
Angular JS - Introduction
PDF
AngularJS By Vipin
[Ebooks PDF] download AngularJS 1st Edition Brad Green full chapters
Learning AngularJS - Complete coverage of AngularJS features and concepts
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
ME vs WEB - AngularJS Fundamentals
Angular js for Beginnners
Getting Started With AngularJS
AngularJS for Beginners
Angular Presentation
Getting Started with AngularJS
Angular js gtg-27feb2013
AngularJS Curriculum-Zeolearn
Angular training - Day 3 - custom directives, $http, $resource, setup with ye...
Introduction to AngularJS
Intro to AngularJs
angularjs_tutorial.docx
Angularjs basic part01
Practical AngularJS
Angular JS - Introduction
AngularJS By Vipin
Ad

Recently uploaded (20)

PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
Basic Mud Logging Guide for educational purpose
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPTX
master seminar digital applications in india
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PPTX
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
Complications of Minimal Access Surgery at WLH
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
O7-L3 Supply Chain Operations - ICLT Program
PPTX
Week 4 Term 3 Study Techniques revisited.pptx
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
Institutional Correction lecture only . . .
PDF
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
human mycosis Human fungal infections are called human mycosis..pptx
Module 4: Burden of Disease Tutorial Slides S2 2025
Basic Mud Logging Guide for educational purpose
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
master seminar digital applications in india
Renaissance Architecture: A Journey from Faith to Humanism
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Abdominal Access Techniques with Prof. Dr. R K Mishra
VCE English Exam - Section C Student Revision Booklet
Complications of Minimal Access Surgery at WLH
Anesthesia in Laparoscopic Surgery in India
O7-L3 Supply Chain Operations - ICLT Program
Week 4 Term 3 Study Techniques revisited.pptx
2.FourierTransform-ShortQuestionswithAnswers.pdf
Institutional Correction lecture only . . .
Mark Klimek Lecture Notes_240423 revision books _173037.pdf

Angular js workshop

  • 2. Agenda AngularJS core principles Building a sample web site to demonstrate how AngularJS works (from the scratch) Some words about AngularJS 2 Practical tasks (if there is time and energy)
  • 3. Youth Techclub Youth Techclub brings together young people that are interested in building their skills in information technology by sharing knowledge and exploring. Wide variety of people – coders, graphic designers, idea generators.. Workshops, meet-up’s, external speakers. Apply via official Facebook page (search for «Youth Techclub»)
  • 4. Youth Techclub next semester Azure Web Apps (from Dreamspark students) Web development: - HTML5/CSS3 - Javascript - jQuery - Angular, Angular 2.0 ASP.NET: - MVC - Web API GitHub: - Git usage Mobile app development: - Xamarin (cross platform development) Unit testing Test driven development Agile principles ASO (app store optimization)
  • 5. Me Studying Masters in RTU Youth Techclub founder Microsoft Student partner Student fraternity Latvia Cyber-unit
  • 6. Lets clear some things… There are things that are hard to translate to Latvian Workshop is an introduction to AngularJS I’m only one so I won’t be able to help you all Demo gods can be cruel some times if you have not offered a tribute for some time 
  • 7. Some tools we will use NodeJS – server-side JavaScript runtime Bower package manager – handles getting client side packages in web development Node package manager – handles getting server side packages in web development Bootstrap – UI framework to help with responsive web sites
  • 8. NodeJS Install from https://nodejs.org/en/ You can use both the mature and the latest version Visual Studio comes with built-in NodeJS support, but the version is not the latest
  • 9. Bower In command line execute – npm install –g bower Navigate to solution and execute - bower init bower.json file is created, it will contain the list of packages installed
  • 10. Lets get to the business …
  • 11. What is AngularJS and why it is popular? Open-source web application framework maintained by Google Addresses challenges encountered in developing single-page applications Decoupling and dependency injection Makes testing very easy and code modular
  • 12. Lets understand how AngularJS works AngularJS application – defined by ng-app attribute in HTML, creates $rootScope Modules – logically splits application Views – renders HTML to user Controller – manipulates data and business logic
  • 13. More complete picture Config – you can configure different aspects of modules – routing, dependencies, HTTP request handling and lot more Routes – defines URL for modules $scope – local $scope for controller, shared with view Directives – markers in DOM that instruct Angular to attach specified behaviour to DOM element Service – encapsulates common logic
  • 14. Lets prepare solution 1. Create index.html file 2. Create folders «app» and «assets» 3. Create folder «libs» in «assets» 4. Init bower (or add through VS) 5. Copy required libraries to libs folder 6. Add libraries in index.html
  • 15. Lets create AngularJS Hello world! 1. Create ng-app tag in HTML 2. Create div element and attach controller to it 3. Create app.module.js in «app» folder 4. Define common module, myApp module and a controller 5. Test scoped variables
  • 16. Directives Directive defined in code must match the directive in HTML markup. 4 ways to define in markup: <my-dir></my-dir> <span my-dir=«exp»></span> <!– directive; my-dir exp --> <span class=«my-dir: exp;»></span> ‘Restrict’ option defines how to match code with markup Lets create a header navigation directive
  • 17. Some popular built-in directives ngModel – binds input to model value ngClick – specify behaviour when element is clicked ngChange – evaluates expressions when input changes ngRepeat – instantiates template once per item from a collection ngMaxlength – specifies max length for input ngIf – adds/removes DOM element based on expression ngShow – shows/hides DOM element based on expression ngRequired – adds required validator to input field
  • 18. Views DOM elements after Angular is compiled Allows to work with components Handles interaction with user and displaying the state
  • 19. Controller Responsible for constructing the model for a view to interact with Use controller to manipulate data in the scope.
  • 20. Routing You can add routing as a dependency Turns our application in state machine ngRoute vs ui-router
  • 21. Promises A service that helps to run functions asynchronously and use their return values when they are done processing. ES6 style or deffered objects style Promise chaining
  • 22. Demo tasks 1. Add routing with ui-router 2. Create header as a directive 3. Create table with source data from service 4. Create a form to send data to service 5. Add custom validations to form
  • 23. AngularJS 2.0 Complete rewrite, not compatible with previous versions Written in TypeScript Some changes - faster, new router, no controllers, no $scope, different types of directives,
  • 25. Tasks 1. Add more validations to form (pattern, max number, etc.) 2. Add .gif loading symbol while GET/POST is executing 3. Enable form button if all fields are filled and form is valid 4. Any other suggestions from your side?
  • 26. Thank you! Your feedback is welcomed! 