Setting up an Angular 2 project
Angular 2 code can be written in JavaScript, TypeScript, or Dart. In case you are writing Angular 2 code in TypeScript or Dart, you will need to transpile the code to JavaScript before serving to the client. We will use JavaScript to write Angular 2 code.
Create a directory named angular2-demo. Then, inside the directory, create the app.js and package.json files. Then, create a directory named public, and inside the directory, create four more directories named html, js, componentTemplates, and componentStyles. Now, create a file named index.html and place it in the html directory.
Then, download
angular2-polyfills.js, Rx.umd.js, and
angular2-all.umd.js from https://cdnjs.com/libraries/angular.js/ and place them ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access