User Tools

Site Tools


angular

Angular is a javascript framework used in frontend websites

nvm

nvm (Node Version Manager) in an application to manage node.js versions. It works independently for users. You can download it for windows

nvm list

List all node version available to be used

nvm use 12.2.0

Switches to the 12.2.0 version. From this point on, you can use ng with the version attached to this 12.2.0 node.js version

nvm version

Shows the current node.js version

Angular CLI

This is an angular component used to manage the angular application from the command line

You can install it from

npm install -g @angular/cli

From this point on, you can use the command “ng” followed by some arguments to achieve some angular management tasks

ng new myfeed

Will create an angular application called myfeed with the right folder structure.

ng serve

With that sentence you'll get the application running. If you are using an old version of angular CLI, perhaps you'll get an error with the versions when you execute.

ERROR in node_modules/rxjs/internal/types.d.ts(81,44): error TS1005: ';' expected.

This is due to the predefined versions in the package.json. In there you can see things like

a) "rxjs": "6.0.0",
b) "rxjs": "^6.0.0",
c) "rxjs": "~6.0.0",

If ther is no operator (a), it means that the exact 6.0.0 version is required, and it will be downloaded when the “npm install” is done. If there is a“^” operator (b) it means that npm install will get the latest version of the major version of the component, what means that the first number will be allways the same. If there is a “~” operator ©, it means that npm install will get the latest version of the minor version, what means that the first two numbers will be unaltered.

ng generate component feed

It will create a new component called FeedComponent

ng generate interface feed

It will create an interface called Feed

angular.txt · Last modified: 2020/06/01 10:18 by admin