SlideShare a Scribd company logo
Angular 2 Seed Project Step by Step configurations by Shubham
Step 1. Create a directory in which your project resides
$ mkdir angular-2-seed
$ cd angular-2-seed
Step 2. Create config files and configured as your requirements
package.json -> npm package dependencies
tsconfig.json -> typescript compiler generate javascript code.
typings.json
systemjs.config.js
See reference here “https://github.com/codershubhamverma/angular2-seed”
Or clone repository from here and see the config files.
“https://github.com/codershubhamverma/angular2-seed.git"
Step 3. Install packages
$ npm install —save
After installing your project folder directory structure will be look like like this
angular-2-seed
|_ node_modules
|_typings
|_package.json
|_system.config.josn
|_typings.json
Note: Make sure u did not get any error while installing npm packages, if found
message npm ERR! means some packages did not installed, so reinstall this again
by typing “npm install”. Err will occur if network failure in most of the cases.
Step 4. Everything is setup now time to create you app in angular2
Create application folder
$ mkdir app
Step 5. Create the file app/app.module.ts and write the code below
// This is the entry point to your application
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
@NgModule({
imports: [ BrowserModule ]
})
export class AppModule { }
Step 6. Create a component and add it to application.
Create file app/app.component.ts with the code below
import { Component } from '@angular/core';
@Component({
selector: 'my-app',
template: ‘<h1>Welcome to the world of angular 2</h1>'
})
export class AppComponent { }
Step 7. Edit the file app/app.module.ts to import your new AppComponent and add
it in the declarations and bootstrap fields in the NgModule decorator
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';
@NgModule({
imports: [BrowserModule],
declarations: [AppComponent],
bootstrap: [AppComponent]
})
export class AppModule { }
Step 8. Run project.
Create file “app/main.ts” with the code below
import { platformBrowserDynamic } from '@angular/platform-browser-
dynamic';
import { AppModule } from './app.module';
const platform = platformBrowserDynamic();
platform.bootstrapModule(AppModule);
“This code initializes the platform that your application runs in, then uses the
platform to bootstrap your AppModule.”
Step 9. Define the page that host your app. create an index.js in root of your
project.
<html>
<head>
<title>Angular 2 Demo By Shubham</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="styles.css">
<!-- 1. Load libraries -->
<script src="node_modules/core-js/client/shim.min.js"></script>
<script src="node_modules/zone.js/dist/zone.js"></script>
<script src="node_modules/reflect-metadata/Reflect.js"></script>
<script src="node_modules/systemjs/dist/system.src.js"></script>
<!-- 2. Configure SystemJS -->
<script src="systemjs.config.js"></script>
<script>
System.import('app').catch(function(err){ console.error(err); });
</script>
</head>
<!-- 3. Display the application -->
<body>
<my-app>Loading...</my-app>
</body>
</html>
Step 10. Create a style.css in root of your project.
Step 11. Run your first demo app.
$ npm start

More Related Content

What's hot

Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...
Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...
Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...
Atlassian
 
The Joy of Gems: Cooking up Rails Plugins
The Joy of Gems: Cooking up Rails PluginsThe Joy of Gems: Cooking up Rails Plugins
The Joy of Gems: Cooking up Rails Plugins
Paul McMahon
 

What's hot (20)

Remote Config REST API and Versioning
Remote Config REST API and VersioningRemote Config REST API and Versioning
Remote Config REST API and Versioning
 
Express: A Jump-Start
Express: A Jump-StartExpress: A Jump-Start
Express: A Jump-Start
 
Gigigo Rails Workshop
Gigigo Rails WorkshopGigigo Rails Workshop
Gigigo Rails Workshop
 
ADF in action 1.2
ADF in action 1.2ADF in action 1.2
ADF in action 1.2
 
AngularJS2 / TypeScript / CLI
AngularJS2 / TypeScript / CLIAngularJS2 / TypeScript / CLI
AngularJS2 / TypeScript / CLI
 
The productive developer guide to Angular 2
The productive developer guide to Angular 2The productive developer guide to Angular 2
The productive developer guide to Angular 2
 
Einführung in Angular 2
Einführung in Angular 2Einführung in Angular 2
Einführung in Angular 2
 
Angular js 2
Angular js 2Angular js 2
Angular js 2
 
Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...
Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...
Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...
 
Pundit
PunditPundit
Pundit
 
Rack
RackRack
Rack
 
Angular 2
Angular 2Angular 2
Angular 2
 
StartupDecode - Meetup #00
StartupDecode - Meetup #00StartupDecode - Meetup #00
StartupDecode - Meetup #00
 
Ajax pagination using j query in rails3
Ajax pagination using j query in rails3Ajax pagination using j query in rails3
Ajax pagination using j query in rails3
 
Angular 5
Angular 5Angular 5
Angular 5
 
Devise and Rails
Devise and RailsDevise and Rails
Devise and Rails
 
The Joy of Gems: Cooking up Rails Plugins
The Joy of Gems: Cooking up Rails PluginsThe Joy of Gems: Cooking up Rails Plugins
The Joy of Gems: Cooking up Rails Plugins
 
Introduction to Angular 2
Introduction to Angular 2Introduction to Angular 2
Introduction to Angular 2
 
Angular 2 - The Next Framework
Angular 2 - The Next FrameworkAngular 2 - The Next Framework
Angular 2 - The Next Framework
 
Async patterns in javascript
Async patterns in javascriptAsync patterns in javascript
Async patterns in javascript
 

Viewers also liked

Marketing account executive kpi
Marketing account executive kpiMarketing account executive kpi
Marketing account executive kpi
gkatgutos
 

Viewers also liked (11)

Trabajo tercer corte
Trabajo tercer corteTrabajo tercer corte
Trabajo tercer corte
 
Stand up for the net - Mid-Day
Stand up for the net - Mid-Day Stand up for the net - Mid-Day
Stand up for the net - Mid-Day
 
Just who is groupon's new interim ceo
Just who is groupon's new interim ceoJust who is groupon's new interim ceo
Just who is groupon's new interim ceo
 
15-YEAR-OLD LAUNCHES WORLD-CLASS WEBSITE TO HELP OTHERS
15-YEAR-OLD LAUNCHES WORLD-CLASS WEBSITE TO HELP OTHERS15-YEAR-OLD LAUNCHES WORLD-CLASS WEBSITE TO HELP OTHERS
15-YEAR-OLD LAUNCHES WORLD-CLASS WEBSITE TO HELP OTHERS
 
Periscope and Meerkat: Why broadcasters should stop worrying and learn to lov...
Periscope and Meerkat: Why broadcasters should stop worrying and learn to lov...Periscope and Meerkat: Why broadcasters should stop worrying and learn to lov...
Periscope and Meerkat: Why broadcasters should stop worrying and learn to lov...
 
AN INTERVIEW WITH JASON FERNANDES, WHO PROVES THAT DISABILITY OR OTHERWISE, T...
AN INTERVIEW WITH JASON FERNANDES, WHO PROVES THAT DISABILITY OR OTHERWISE, T...AN INTERVIEW WITH JASON FERNANDES, WHO PROVES THAT DISABILITY OR OTHERWISE, T...
AN INTERVIEW WITH JASON FERNANDES, WHO PROVES THAT DISABILITY OR OTHERWISE, T...
 
Google Glass, Project Aura and the Segway strategy
Google Glass, Project Aura and the Segway strategyGoogle Glass, Project Aura and the Segway strategy
Google Glass, Project Aura and the Segway strategy
 
Marketing account executive kpi
Marketing account executive kpiMarketing account executive kpi
Marketing account executive kpi
 
LETS BUILD A COMMUNITY ON THE NET -  Bombay Times
LETS BUILD A COMMUNITY ON THE NET - 	Bombay Times LETS BUILD A COMMUNITY ON THE NET - 	Bombay Times
LETS BUILD A COMMUNITY ON THE NET -  Bombay Times
 
Cuadrante exámenes de septiembre
Cuadrante exámenes de septiembreCuadrante exámenes de septiembre
Cuadrante exámenes de septiembre
 
Why Yahoo’s identity crisis could finish it off
Why Yahoo’s identity crisis could finish it offWhy Yahoo’s identity crisis could finish it off
Why Yahoo’s identity crisis could finish it off
 

Similar to anugula2setupbyshubham

HotPush with Ionic 2 and CodePush
HotPush with Ionic 2 and CodePushHotPush with Ionic 2 and CodePush
HotPush with Ionic 2 and CodePush
Evan Schultz
 

Similar to anugula2setupbyshubham (20)

Ng2 cli
Ng2 cliNg2 cli
Ng2 cli
 
Angular Notes.pdf
Angular Notes.pdfAngular Notes.pdf
Angular Notes.pdf
 
An Overview of Angular 4
An Overview of Angular 4 An Overview of Angular 4
An Overview of Angular 4
 
How to Implement Micro Frontend Architecture using Angular Framework
How to Implement Micro Frontend Architecture using Angular FrameworkHow to Implement Micro Frontend Architecture using Angular Framework
How to Implement Micro Frontend Architecture using Angular Framework
 
Angular 7 Firebase5 CRUD Operations with Reactive Forms
Angular 7 Firebase5 CRUD Operations with Reactive FormsAngular 7 Firebase5 CRUD Operations with Reactive Forms
Angular 7 Firebase5 CRUD Operations with Reactive Forms
 
Building an angular application -1 ( API: Golang, Database: Postgres) v1.0
Building an angular application -1 ( API: Golang, Database: Postgres) v1.0Building an angular application -1 ( API: Golang, Database: Postgres) v1.0
Building an angular application -1 ( API: Golang, Database: Postgres) v1.0
 
Orangescrum In App Chat Add-on User Manual
Orangescrum In App Chat Add-on User ManualOrangescrum In App Chat Add-on User Manual
Orangescrum In App Chat Add-on User Manual
 
Peggy angular 2 in meteor
Peggy   angular 2 in meteorPeggy   angular 2 in meteor
Peggy angular 2 in meteor
 
Implementation of Push Notification in React Native Android app using Firebas...
Implementation of Push Notification in React Native Android app using Firebas...Implementation of Push Notification in React Native Android app using Firebas...
Implementation of Push Notification in React Native Android app using Firebas...
 
Angular performance slides
Angular performance slidesAngular performance slides
Angular performance slides
 
Angularjs - Unit testing introduction
Angularjs - Unit testing introductionAngularjs - Unit testing introduction
Angularjs - Unit testing introduction
 
appledoc_style
appledoc_styleappledoc_style
appledoc_style
 
Using JHipster for generating Angular/Spring Boot apps
Using JHipster for generating Angular/Spring Boot appsUsing JHipster for generating Angular/Spring Boot apps
Using JHipster for generating Angular/Spring Boot apps
 
How to Implement Basic Angular Routing and Nested Routing With Params in Angu...
How to Implement Basic Angular Routing and Nested Routing With Params in Angu...How to Implement Basic Angular Routing and Nested Routing With Params in Angu...
How to Implement Basic Angular Routing and Nested Routing With Params in Angu...
 
Virtual Environment and Web development using Django
Virtual Environment and Web development using DjangoVirtual Environment and Web development using Django
Virtual Environment and Web development using Django
 
Exploring Angular 2 - Episode 1
Exploring Angular 2 - Episode 1Exploring Angular 2 - Episode 1
Exploring Angular 2 - Episode 1
 
Angular JS2 Training Session #2
Angular JS2 Training Session #2Angular JS2 Training Session #2
Angular JS2 Training Session #2
 
Angular4 getting started
Angular4 getting startedAngular4 getting started
Angular4 getting started
 
HotPush with Ionic 2 and CodePush
HotPush with Ionic 2 and CodePushHotPush with Ionic 2 and CodePush
HotPush with Ionic 2 and CodePush
 
Setting up the hyperledger composer in ubuntu
Setting up the hyperledger composer in ubuntuSetting up the hyperledger composer in ubuntu
Setting up the hyperledger composer in ubuntu
 

anugula2setupbyshubham

  • 1. Angular 2 Seed Project Step by Step configurations by Shubham Step 1. Create a directory in which your project resides $ mkdir angular-2-seed $ cd angular-2-seed Step 2. Create config files and configured as your requirements package.json -> npm package dependencies tsconfig.json -> typescript compiler generate javascript code. typings.json systemjs.config.js See reference here “https://github.com/codershubhamverma/angular2-seed” Or clone repository from here and see the config files. “https://github.com/codershubhamverma/angular2-seed.git" Step 3. Install packages $ npm install —save After installing your project folder directory structure will be look like like this angular-2-seed |_ node_modules |_typings |_package.json |_system.config.josn |_typings.json Note: Make sure u did not get any error while installing npm packages, if found message npm ERR! means some packages did not installed, so reinstall this again by typing “npm install”. Err will occur if network failure in most of the cases. Step 4. Everything is setup now time to create you app in angular2 Create application folder $ mkdir app Step 5. Create the file app/app.module.ts and write the code below // This is the entry point to your application import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; @NgModule({ imports: [ BrowserModule ] })
  • 2. export class AppModule { } Step 6. Create a component and add it to application. Create file app/app.component.ts with the code below import { Component } from '@angular/core'; @Component({ selector: 'my-app', template: ‘<h1>Welcome to the world of angular 2</h1>' }) export class AppComponent { } Step 7. Edit the file app/app.module.ts to import your new AppComponent and add it in the declarations and bootstrap fields in the NgModule decorator import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { AppComponent } from './app.component'; @NgModule({ imports: [BrowserModule], declarations: [AppComponent], bootstrap: [AppComponent] }) export class AppModule { } Step 8. Run project. Create file “app/main.ts” with the code below import { platformBrowserDynamic } from '@angular/platform-browser- dynamic'; import { AppModule } from './app.module'; const platform = platformBrowserDynamic(); platform.bootstrapModule(AppModule); “This code initializes the platform that your application runs in, then uses the platform to bootstrap your AppModule.”
  • 3. Step 9. Define the page that host your app. create an index.js in root of your project. <html> <head> <title>Angular 2 Demo By Shubham</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="styles.css"> <!-- 1. Load libraries --> <script src="node_modules/core-js/client/shim.min.js"></script> <script src="node_modules/zone.js/dist/zone.js"></script> <script src="node_modules/reflect-metadata/Reflect.js"></script> <script src="node_modules/systemjs/dist/system.src.js"></script> <!-- 2. Configure SystemJS --> <script src="systemjs.config.js"></script> <script> System.import('app').catch(function(err){ console.error(err); }); </script> </head> <!-- 3. Display the application --> <body> <my-app>Loading...</my-app> </body> </html> Step 10. Create a style.css in root of your project. Step 11. Run your first demo app. $ npm start