Hacker News clone with Angular 2: Setup up development environment

Опубликовано: 19 Май 2025
на канале: KG IT Systems Consulting
407
2

Increasing complexity of the angular makes initial setup harder than angularjs applications. There are many external dependencies such as module loaders, browser shims, new change detection library. Therefore it is prefered to use a starter template that is to say a seed project. There are many seed projects for angular2 which supports different build and module systems such as gulp, grunt or webpack. You can choose among those frameworks. A simple search on github will return many angular seed projects. But I will use angular command line interface to start our project. Angular command line is called angular-cli and developed by the angular team. Actual implementation of angular-cli requires node version 4 or above and npm version 3 or above. To install angular cli you need to use npm as follows:

npm install -g angular-cli

Once we installed angular cli we can generate our first project and start development server by using angular-cli

ng new hackernews
cd hackernews
ng serve


A list of angular 2 seed repos can be found here:   / helpful_github_repos_curated_through_may_2016