mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-08 23:58:13 +08:00
fix(angular): add injectable decorator to fix injectable issues
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
// import { AlertController } from '@ionic/angular';
|
||||
import { AlertController } from '@ionic/angular';
|
||||
|
||||
@Component({
|
||||
selector: 'app-alert-page',
|
||||
@ -21,18 +21,17 @@ import { Component } from '@angular/core';
|
||||
})
|
||||
export class AlertPageComponent {
|
||||
|
||||
constructor(/*private alertController: AlertController*/) {
|
||||
constructor(private alertController: AlertController) {
|
||||
|
||||
}
|
||||
|
||||
clickMe() {
|
||||
/*const alert = this.alertController.create({
|
||||
const alert = this.alertController.create({
|
||||
title: 'ohhhh snap',
|
||||
message: 'Gretting from an ng cli app',
|
||||
|
||||
});
|
||||
alert.present();*/
|
||||
alert('yeah');
|
||||
alert.present();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -4,6 +4,8 @@ import { CommonModule } from '@angular/common';
|
||||
import { AlertPageComponent } from './alert-page.component';
|
||||
import { AlertRoutingModule } from './alert-routing.module';
|
||||
|
||||
import { AlertController } from '@ionic/angular';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
|
||||
@ -4,7 +4,7 @@ import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
|
||||
import { AppComponent } from './app.component';
|
||||
import { AppRoutingModule } from './app-routing.module';
|
||||
|
||||
// import { IonicAngularModule } from '@ionic/angular';
|
||||
import { AlertController } from '@ionic/angular';
|
||||
|
||||
@NgModule({
|
||||
declarations: [AppComponent],
|
||||
@ -13,7 +13,9 @@ import { AppRoutingModule } from './app-routing.module';
|
||||
BrowserModule,
|
||||
// IonicAngularModule
|
||||
],
|
||||
providers: [],
|
||||
providers: [
|
||||
AlertController
|
||||
],
|
||||
bootstrap: [AppComponent],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user