text 离子训练笔记

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了text 离子训练笔记相关的知识,希望对你有一定的参考价值。

How to create new page
==

1. Ionic generate page pokemon-list

2. Pages need to be imported and declared in the declarations and entryComponents inside app.module.ts


Tabs layout
==

1. When using tabs, we need to imported and declared new page inside tabs.ts


Using Ionic provider
==

1. Inject at provider in app.module.ts

2. Import http module in app.module.ts

import { BrowserModule } from '@angular/platform-browser';
import { NgModule, ErrorHandler } from '@angular/core';
import { HttpModule } from '@angular/http';
...
  imports: [
    BrowserModule,
    HttpModule,
    IonicModule.forRoot(MyApp),
    IonicStorageModule.forRoot()
  ],
...

3. Import HttpClientModule in app.module.ts

==

Navigate to page
==

1. If use lazy loading, no need import page in app.module.ts


Push to ionic view
==

git push ionic master

Troubleshoot common error
==

1. No component factory found for Component

Solution :

Pages need to be imported and declared in the declarations and entryComponents inside app.module.ts

source : https://forum.ionicframework.com/t/rc0-no-component-factory-found-for-componenta/65249/2

2. https://devdactic.com/10-ionic-problems/#more-4104

3. No provider for HTTP error

import { BrowserModule } from '@angular/platform-browser';
import { NgModule, ErrorHandler } from '@angular/core';
import { HttpModule } from '@angular/http';
...
  imports: [
    BrowserModule,
    HttpModule,
    IonicModule.forRoot(MyApp),
    IonicStorageModule.forRoot()
  ],
...

source : https://forum.ionicframework.com/t/no-provider-for-http-error-in-ionic/85762

4. No provider for HTTP client

- Import HttpClientModule in app.module.ts

5. Failed to load. has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

- Use chrome cors extension

5. ionic tabs stuck at about

- comment and ucomment back route

6. undefined object

“Error: Uncaught (in promise): EXCEPTION: TypeError: Cannot read property ‘name’ of undefined in

https://forum.ionicframework.com/t/problem-with-object/51448/2

以上是关于text 离子训练笔记的主要内容,如果未能解决你的问题,请参考以下文章

text 离子训练参考

text 离子部署到android

text 更新离子

text 离子设置

text 未找到离子模块'FirebaseInstanceID'

text 离子与 - VUE