I just want to create a simple component from the ionic cli
ionic g component google-map
This is my app.module.ts file
import { BrowserModule } from '@angular/platform-browser';
import { ErrorHandler, NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';
import { SplashScreen } from '@ionic-native/splash-screen';
import { StatusBar } from '@ionic-native/status-bar';
import { Geolocation } from '@ionic-native/geolocation';
import { MyApp } from './app.component';
import { HomePage } from '../pages/home/home';
import { GeotagPage } from '../pages/geotag/geotag';
import { GoogleMapPage } from '../pages/google-map/google-map';
import { GeotagPageModule } from '../pages/geotag/geotag.module';
import { GoogleMapPageModule } from '../pages/google-map/google-map.module';
import { GooglemapComponent } from '../components/googlemap/googlemap';
@NgModule({
declarations: [
MyApp,
HomePage,
GooglemapComponent
],
imports: [
BrowserModule,
IonicModule.forRoot(MyApp),
GeotagPageModule,
GoogleMapPageModule
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
HomePage,
GeotagPage,
GoogleMapPage
],
providers: [
StatusBar,
Geolocation,
SplashScreen,
{provide: ErrorHandler, useClass: IonicErrorHandler}
],
})
export class AppModule {}
my component file.ts
import { Component } from '@angular/core';
/**
* Generated class for the GooglemapComponent component.
*
* See https://angular.io/api/core/Component for more info on Angular
* Components.
*/
@Component({
selector: 'googlemap',
templateUrl: 'googlemap.html'
})
export class GooglemapComponent {
text: string;
constructor() {
console.log('Hello GooglemapComponent Component');
this.text = 'Hello World';
}
}
and lastly the component.module.ts
import { NgModule } from '@angular/core';
import { GooglemapComponent } from './googlemap/googlemap';
@NgModule({
declarations: [GooglemapComponent],
imports: [],
exports: [GooglemapComponent]
})
export class ComponentsModule {}
I dont know whats wrong with creating a simple component it keeps telling me
Template parse errors: ‘googlemap’ is not a known element:1.
Can someone tell me on what wrong with this? Anyone that can guide me through this