User Tools

Site Tools


angular

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
angular [2020/06/01 08:07]
admin
angular [2020/06/01 10:18] (current)
admin [Angular CLI]
Line 1: Line 1:
 Angular is a javascript framework used in frontend websites 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 [[https://​github.com/​coreybutler/​nvm-windows/​releases|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 ====== ====== Angular CLI ======
Line 12: Line 29:
   ng new myfeed   ng new myfeed
  
-Will create an angular application called myfeed with the right folder structure+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 (c), 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.1590991620.txt.gz · Last modified: 2020/06/01 08:07 by admin