Problems encountered Angular learning

Angular development in a VS Code will need to install plug-ins:
https://www.cnblogs.com/linzhanfly/p/10673400.html
TSLint: Typescript grammar check
Prettier: code formatting
IntelliJ IDEA Keybindings: IDEA-style shortcuts
Angular 7 Snippets : Angular syntax filling (label)
Angular files: Angular generated file template (Component, Module, Pipe, etc.)
Angular the Follow Selector: files Jump (Component Jump to html, scss file)
Angular Language Service: references and fill Jump (referenced in the html completion) to define
debugger for Chrome: Angular Code debugging


Creating two custom modules: Routing module needs to add --routing
ng Module Pages and the G / the User
ng Module Pages and the G / the User --routing

With user module routing, file, you should write <router-outlet> </ router -outlet> in the user's html in
any component lazy loading of modules does not require the introduction of import, but you need to create a custom module to the component, welcome.module.ts module is introduced
eg:

{ path: 'welcome', loadChildren: () => import('./pages/welcome/welcome.module').then(m => m.WelcomeModule) },

 

When three angular with ant Design, and follow the steps in the Quick Start ant design to their own global import, ant design styles found or can not be displayed, a step less global style introduction:

@import "~ of-zorro-antd / src / Zorro-of-antd.css"

All steps are:
1. Install the latest angular scaffolding (antd support more than angular5.0 version, it is best to update your scaffolding)
npm install -g @ angular / cli @ Latest

2. New Project
ng new my-app

3. Download antd
npm install ng-Zorro-antd --save

4. introduce the following two modules (BrowserModule ngModule and the like is not written below, where only the write module Added)

import {BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { NgZorroAntdModule } from 'ng-zorro-antd';

The implantation of two or more modules

imports: [ BrowserAnimationsModule, NgZorroAntdModule]

6. The most important step
is introduced in style.css file under src directory

@import " ~ of-zorro-antd / src / Zorro-of-antd.css " ;

 

Four   use form form given: Can not bind to 'formGroup' since it is not a known property of 'form'

Because there is no module in a form incorporated in app.module.ts:

import {FormsModule, ReactiveFormsModule} from '@angular/forms'; // 表单

 

Five questions encountered:

The ant-design angular table, because the use of the index page leads to index every page are from the beginning?

 

 

Guess you like

Origin www.cnblogs.com/mainblogwhy/p/12426946.html