Angular
Angular
Agenda
• Introduction to Angular.
• Angular-2
• Why Angular-2.
• Setup.
Introduction to AnguarJs
• AnguarJs is a very powerful JavaScript Framework.
• It is a library written in JavaScript.
• It help us to create a reactive SPA.
• AnguarJs is open source, completely free, and used by
thousands of developers around the world.
Difference between Version’s
• AnguarJs is a very powerful JavaScript Framework it
helped us to create great user exp web apps.
• Angular-2 – it was complete re-write of angular-1 and
future of angular. You donot need to worry or learn
angularjs.
• Angular-4 – it is a version update of angular-2.
Angular -2
• It was announced in Sep 2016.
• Angular 2 is the next version of Google’s massively
popular MV* framework for building complex applications
in the browser (and beyond).
• Angular 2 comes with almost everything you need to
build a complicated frontend web or mobile apps, from
powerful templates to fast rendering, data management,
HTTP services, form handling, and so much more.
Features of Angular 2
• Components - The earlier version of Angular had a focus of
Controllers but now has changed the focus to having components
over controllers. Components help to build the applications into
many modules. This helps in better maintaining the application
over a period of time.
• Typescript − The newer version of Angular is based on Typescript.
This is a superset of JavaScript and is maintained by Microsoft
• Services − Services are a set of code that can be shared by different
components of an application. So for example if you had a data
component that picked data from a database, you could have it as a
shared service that could be used across multiple applications.
• Better event-handling capabilities, powerful templates, and better
support for mobile devices.
Components of Angular 2
• Modules − This is used to break up the application into
logical pieces of code. Each piece of code or module is
designed to perform a single task.
• Component − This can be used to bring the modules
together.
• Templates − This is used to define the views of an Angular
JS application.
• Metadata − This can be used to add more data to an
Angular JS class.
• Service − This is used to create components which can be
shared across the entire application.
Angular 2 Environment
• Npm − Node package manager that is used to work with
the open source repositories. Angular JS as a framework
has dependencies on other components. And npm can be
used to download these dependencies and attach them to
your project.
• Git − This is the source code software that can be used to
get the sample project from the github angular site.
• Editor − There are many editors that can be used for
Angular JS development such as Visual Studio code and
WebStorm. In our tutorial, we will use Visual Studio code
which comes free of cost from Microsoft.
Getting started with first Angular JS App:
• One way is to do everything from scratch which is the most difficult
and not the preferred way. Due to the many dependencies, it
becomes difficult to get this setup.
Example:
export class AppComponent {
appTitle: string = 'Welcome';
}
Metadata
This is used to decorate Angular JS class with additional information.
Template:
This is the view which needs to be rendered in the application.
Q&A