angular2

A 16-post collection

Angular 2 : Giving Your CLI a Server

...be sure to read Angular 2:Re-Quickstart with the CLI Although the CLI includes a number of great features, the deployment of the application is a story or issue that is still under discussion (Production deploy #326). What is the right server, what are the features etc. A simple static server for Angular applications should be able to handle a few things: static files - like that pesky fav.ico, images, css, and javascript files deep links - routing to specific portion of our SPA maybe something simple like compression In this case, node.js using Express fits the bill. Let's see how to add it to the quickstart generated in the previous post. First, grab the index.js and...


Angular 2 : A Re-Quickstart using the CLI

The Angular team created a quickstart which is a great starter project template and I've covered that in another post which shows adding an express server to that to get you up and running with a more complete quickstart at Angular 2 : Getting Off the Starting Line. Both are great starters, but static templates. This Re-Quickstart* is using the CLI (command line interface) to create the same application in a fraction of the time. angular-cli The angular-cli is the new command line interface for creating Angular 2 applications. Well, It's much more than that. It creates applications, follows the best practice or approved style guide, sets up the tests, runs the tests and much more. Head over to cli.angular....


Angular 2 : Continuous Integration to Azure using Codeship and the Angular CLI

Getting an application written is the first challenge, however having proper tests, running those tests in a continuous integration pipeline as well as deploying the application to your cloud host can be a task to setup. Here is a quickstart to create an application using the angular-cli, using codeship to build and run the test using the angular-cli and the push to a website on Azure. Using the angular-cli we can quickly create an application by executing the commands... ng new quickstart-ng-cli cd quickstart-ng-cli ng serve Once that is scaffolded out, create your GitHub repo and check in the source. For a full angular-cli walk through look at my post Angular 2: A Re-Quickstart using the CLI Codeship Go to...


Angular 2 : Organization Using {barrels}

The import statements in Angular 2 can get pretty cumbersome if you're using a lot of services, models, directives etc in any specific component. Looking at the basic "QuickStart", the app.component.ts doesn't seem very obtuse. import {Component} from 'angular2/core'; @Component({ selector: 'my-app', template: '<h1>Quickstart</h1>' }) export class AppComponent { } However, looking at the Tour of Heroes example: import { Component } from '@angular/core'; import { RouteConfig, ROUTER_DIRECTIVES, ROUTER_PROVIDERS } from '@angular/router-deprecated'; import { HeroService } from './hero.service'; import { DashboardComponent } from './dashboard.component'; import { HeroesComponent } from './heroes.component'; import { HeroDetailComponent } from './hero-detail.component'; @Component({ selector: 'my-app', template: ` <h1>{{title}}</h1> <nav>...


How To: Visual Studio 2015 & Angular 2

There has been a few request I have seen lately on how to get an Angular 2 development environment going using Visual Studio 2015. any one please guide me to video or blog, configuring Visual Studio 2015 for AngularJS 2 development using TypeScript— Dhananjay Kumar (@debug_mode) April 29, 2016 My recent post "Angular 2 : Getting off the Starting Line" takes the Angular Team's Quickstart and adds a gulp build process, this is the project I'll use for the walkthrough. First, clone https://github.com/spboyer/ng2-startingline . You can either do this on the command line or within the Visual Studio 2015 Git add in. Next, File > Open website and select the folder you cloned the project to. When...