I'm starting my Angular 2 journey with the official quick start guide on the Angular 2 website, https://angular.io/. I'm going to use the TypeScript version of the quick start guide, since I plan on coding Angular 2 with TypeScript.
I already have Node installed on my Mac laptop via nvm (Node Version Manager), so that's taken care of.
I want to figure out any nuances involved in using IntelliJ as my IDE for coding Angular 2 (it SHOULD work similarily to how WebStorm works in the regard), so I want to create a new IntelliJ project to house the quick start files. Did a quick search for any IntelliJ plugins that would semi-automate the setup of a new Angular 2 codebase in an IntelliJ project, but didn't find any. Probably just as well: I expect to start using the Angular CLI tool for that sort of thing as I get further along anyway. So I created a new project in IntelliJ pointed to my "angular-io-quickstart" directory. IntelliJ expects all project files to live in modules, so I created a static web module called "root" (a module choice that doesn't come with any preconfigured structure or code files) which will hold all of the project files. I then created all of the configuration files (package.json, tsconfig.json, etc.) in that root module.
I then ran "npm install" from the angular-io-quickstart/root directory. A "typings" folder was created along with a "node_modules" folder, and there were "typings" modules in "node_modules", so I didn't need to execute the "npm run typings install" command cited in the guide.
The guide does a good job of explaining the different pieces of the app.component.ts file, but a few extra notes:
-
The import statement is a conventional TypeScript import statement (it's not something unique to Angular 2), so further information about its syntax can be found by searching for TypeScript articles on the web.
-
Decorators are also not exclusive to Angular: they are also used in some server-side languages as a means of adding new properties and/or functionality to an object without using extension.
-
The 'app' entry in the "map" object literal tells SystemJS what directory contains the 'app' modules (in this case a directory of the same name).
-
The 'app' entry in the "packages" object literal tells SystemJS that when System.import() is used with the argument 'app' (with no filename specified), it should execute the 'main.js' file...which SystemJS knows from the "map" lives in the "app" directory.
No comments:
Post a Comment