Tag: Udemy – Maximilian Schwarzmüller
Section 2-2 component
It is better to put all files in a new folder named with a meaningful name, such as : server first name component.ts file, which name is normally folder’s name, such as: server.component.ts Component is just Class, angular could instantiate it to create objects in order to let angular understand this class, it should use
Section 2-3 Module
For simple project, only one module is enough, which bundles different components. @NgModule({}) decorator includes: declarations[], imports:[], providers[], bootstrap: [AppComponet] declarations: should declare all components
Section 2-1 How Angular Boots Application
How the Angular app start main.ts file will be executed first, where there is a function, called bootstrapModule(AppModule), that will connect the module in the argument. this module should be a module created by angular, in this module (AppModule) (app.module.ts), it points out bootstrap component (AppComponent) (App.Component.ts) this component has defined the selector (app-root), and
Basic TypeScript
TypeScript could sign variables with different type, and after sign the type, you couldn’t assign other type of value to this variable, or errors will pop up. Syntax: let test: string, if you assign number to this variable, it will be errors. type of variable: :string, :number, :array<string>, :boolean, :any sometimes, TypeScript could infer the
Environment of Running Angular
Install Node.js from https://nodejs.org/en/ Check Node.js version command: node -v Update NPM: sudo npm install -g npm Install Angular CLI (Command Line Interface): sudo npm install -g @angular/cli@latest Check angular verion: ng version | ng –version | ng v