add custom component to ionic page
up vote
0
down vote
favorite
I'm new to Ionic and Angular. I'm trying to make a custom component for MatDatepicker. I using this Gihub link as reference but when I tried to implement it, I'm getting Template parse error. I want this custom component to be used in multiple pages. So if anyone can mention what could be the reason for error it would be great. Thanks.
//Error
ERROR Error: Uncaught (in promise): Error: Template parse errors:
'app-date-picker' is not a known element:
1. If 'app-date-picker' is an Angular component, then verify that it is part of this module.
2. If 'app-date-picker' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
<ion-content padding>
[ERROR ->]<app-date-picker placeholder="Enter The First Date" [(ngModel)]="firstDate" format="YYYY/MM/DD HH:mm:"): ng:///TestpagePageModule/TestpagePage.html@7:2
Error: Template parse errors:
'app-date-picker' is not a known element:
1. If 'app-date-picker' is an Angular component, then verify that it is part of this module.
2. If 'app-date-picker' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
<ion-content padding>
[ERROR ->]<app-date-picker placeholder="Enter The First Date" [(ngModel)]="firstDate" format="YYYY/MM/DD HH:mm:"): ng:///TestpagePageModule/TestpagePage.html@7:2//date-picker.component.ts
import { Component, forwardRef, Input } from '@angular/core';
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
import { MatDatepickerInputEvent } from '@angular/material/datepicker';
import * as moment from 'moment';
@Component({
selector: 'app-date-picker',
templateUrl: './date-picker.component.html',
styleUrls: ['./date-picker.component.css'],
providers: [
{
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => DatePickerComponent),
multi: true
}
]
})
export class DatePickerComponent implements ControlValueAccessor {
/**
* Set the value of the date set by user, notice the underscore infront of the datevalue
*/
@Input() _dateValue: string = null;
/**
* Placeholder value for the material control input
*/
@Input() public placeholder: string = null;
/**
* The date format to use with default format but allowing you to pass a custom date format
*/
@Input() private format = 'YYYY/MM/DD HH:mm:ss';
get dateValue() {
return moment(this._dateValue, this.format);
}
set dateValue(val) {
this._dateValue = moment(val).format(this.format);
this.propagateChange(this._dateValue);
}
addEvent(type: string, event: MatDatepickerInputEvent<Date>) {
this.dateValue = moment(event.value, this.format);
}
writeValue(value: any) {
if (value !== undefined) {
this.dateValue = moment(value, this.format);
}
}
propagateChange = (_: any) => {};
registerOnChange(fn) {
this.propagateChange = fn;
}
registerOnTouched() {}
}//app.module.ts
import { DatePickerComponent } from '../app/utility/date-picker/date-picker.component';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import {MomentDateAdapter,MAT_MOMENT_DATE_FORMATS} from '@angular/material-moment-adapter';
import {
MatDatepickerModule,
MatFormFieldModule,
MatInputModule,
DateAdapter,
MAT_DATE_LOCALE,
MAT_DATE_FORMATS
} from '@angular/material';
@NgModule({
declarations: [AppComponent, DatePickerComponent],
entryComponents: ,
imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule,
BrowserModule,
FormsModule,
ReactiveFormsModule,
BrowserAnimationsModule,
MatDatepickerModule,
MatInputModule,
MatFormFieldModule],
providers: [
StatusBar,
SplashScreen,
{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy },
{
provide: DateAdapter,
useClass: MomentDateAdapter,
deps: [MAT_DATE_LOCALE]
},
{ provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS }
],
bootstrap: [AppComponent]
})
export class AppModule {}angular ionic-framework
add a comment |
up vote
0
down vote
favorite
I'm new to Ionic and Angular. I'm trying to make a custom component for MatDatepicker. I using this Gihub link as reference but when I tried to implement it, I'm getting Template parse error. I want this custom component to be used in multiple pages. So if anyone can mention what could be the reason for error it would be great. Thanks.
//Error
ERROR Error: Uncaught (in promise): Error: Template parse errors:
'app-date-picker' is not a known element:
1. If 'app-date-picker' is an Angular component, then verify that it is part of this module.
2. If 'app-date-picker' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
<ion-content padding>
[ERROR ->]<app-date-picker placeholder="Enter The First Date" [(ngModel)]="firstDate" format="YYYY/MM/DD HH:mm:"): ng:///TestpagePageModule/TestpagePage.html@7:2
Error: Template parse errors:
'app-date-picker' is not a known element:
1. If 'app-date-picker' is an Angular component, then verify that it is part of this module.
2. If 'app-date-picker' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
<ion-content padding>
[ERROR ->]<app-date-picker placeholder="Enter The First Date" [(ngModel)]="firstDate" format="YYYY/MM/DD HH:mm:"): ng:///TestpagePageModule/TestpagePage.html@7:2//date-picker.component.ts
import { Component, forwardRef, Input } from '@angular/core';
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
import { MatDatepickerInputEvent } from '@angular/material/datepicker';
import * as moment from 'moment';
@Component({
selector: 'app-date-picker',
templateUrl: './date-picker.component.html',
styleUrls: ['./date-picker.component.css'],
providers: [
{
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => DatePickerComponent),
multi: true
}
]
})
export class DatePickerComponent implements ControlValueAccessor {
/**
* Set the value of the date set by user, notice the underscore infront of the datevalue
*/
@Input() _dateValue: string = null;
/**
* Placeholder value for the material control input
*/
@Input() public placeholder: string = null;
/**
* The date format to use with default format but allowing you to pass a custom date format
*/
@Input() private format = 'YYYY/MM/DD HH:mm:ss';
get dateValue() {
return moment(this._dateValue, this.format);
}
set dateValue(val) {
this._dateValue = moment(val).format(this.format);
this.propagateChange(this._dateValue);
}
addEvent(type: string, event: MatDatepickerInputEvent<Date>) {
this.dateValue = moment(event.value, this.format);
}
writeValue(value: any) {
if (value !== undefined) {
this.dateValue = moment(value, this.format);
}
}
propagateChange = (_: any) => {};
registerOnChange(fn) {
this.propagateChange = fn;
}
registerOnTouched() {}
}//app.module.ts
import { DatePickerComponent } from '../app/utility/date-picker/date-picker.component';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import {MomentDateAdapter,MAT_MOMENT_DATE_FORMATS} from '@angular/material-moment-adapter';
import {
MatDatepickerModule,
MatFormFieldModule,
MatInputModule,
DateAdapter,
MAT_DATE_LOCALE,
MAT_DATE_FORMATS
} from '@angular/material';
@NgModule({
declarations: [AppComponent, DatePickerComponent],
entryComponents: ,
imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule,
BrowserModule,
FormsModule,
ReactiveFormsModule,
BrowserAnimationsModule,
MatDatepickerModule,
MatInputModule,
MatFormFieldModule],
providers: [
StatusBar,
SplashScreen,
{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy },
{
provide: DateAdapter,
useClass: MomentDateAdapter,
deps: [MAT_DATE_LOCALE]
},
{ provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS }
],
bootstrap: [AppComponent]
})
export class AppModule {}angular ionic-framework
This error suggests that imports are not done correctly. Try adding DatePickerComponent to entry components. I don;t recall what is canonical way to add a component to ionic though
– Sergey Rudenko
Nov 12 at 16:33
Should it be added to declarations or entryComponents or both?
– Somnath Pal
Nov 12 at 16:39
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm new to Ionic and Angular. I'm trying to make a custom component for MatDatepicker. I using this Gihub link as reference but when I tried to implement it, I'm getting Template parse error. I want this custom component to be used in multiple pages. So if anyone can mention what could be the reason for error it would be great. Thanks.
//Error
ERROR Error: Uncaught (in promise): Error: Template parse errors:
'app-date-picker' is not a known element:
1. If 'app-date-picker' is an Angular component, then verify that it is part of this module.
2. If 'app-date-picker' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
<ion-content padding>
[ERROR ->]<app-date-picker placeholder="Enter The First Date" [(ngModel)]="firstDate" format="YYYY/MM/DD HH:mm:"): ng:///TestpagePageModule/TestpagePage.html@7:2
Error: Template parse errors:
'app-date-picker' is not a known element:
1. If 'app-date-picker' is an Angular component, then verify that it is part of this module.
2. If 'app-date-picker' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
<ion-content padding>
[ERROR ->]<app-date-picker placeholder="Enter The First Date" [(ngModel)]="firstDate" format="YYYY/MM/DD HH:mm:"): ng:///TestpagePageModule/TestpagePage.html@7:2//date-picker.component.ts
import { Component, forwardRef, Input } from '@angular/core';
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
import { MatDatepickerInputEvent } from '@angular/material/datepicker';
import * as moment from 'moment';
@Component({
selector: 'app-date-picker',
templateUrl: './date-picker.component.html',
styleUrls: ['./date-picker.component.css'],
providers: [
{
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => DatePickerComponent),
multi: true
}
]
})
export class DatePickerComponent implements ControlValueAccessor {
/**
* Set the value of the date set by user, notice the underscore infront of the datevalue
*/
@Input() _dateValue: string = null;
/**
* Placeholder value for the material control input
*/
@Input() public placeholder: string = null;
/**
* The date format to use with default format but allowing you to pass a custom date format
*/
@Input() private format = 'YYYY/MM/DD HH:mm:ss';
get dateValue() {
return moment(this._dateValue, this.format);
}
set dateValue(val) {
this._dateValue = moment(val).format(this.format);
this.propagateChange(this._dateValue);
}
addEvent(type: string, event: MatDatepickerInputEvent<Date>) {
this.dateValue = moment(event.value, this.format);
}
writeValue(value: any) {
if (value !== undefined) {
this.dateValue = moment(value, this.format);
}
}
propagateChange = (_: any) => {};
registerOnChange(fn) {
this.propagateChange = fn;
}
registerOnTouched() {}
}//app.module.ts
import { DatePickerComponent } from '../app/utility/date-picker/date-picker.component';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import {MomentDateAdapter,MAT_MOMENT_DATE_FORMATS} from '@angular/material-moment-adapter';
import {
MatDatepickerModule,
MatFormFieldModule,
MatInputModule,
DateAdapter,
MAT_DATE_LOCALE,
MAT_DATE_FORMATS
} from '@angular/material';
@NgModule({
declarations: [AppComponent, DatePickerComponent],
entryComponents: ,
imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule,
BrowserModule,
FormsModule,
ReactiveFormsModule,
BrowserAnimationsModule,
MatDatepickerModule,
MatInputModule,
MatFormFieldModule],
providers: [
StatusBar,
SplashScreen,
{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy },
{
provide: DateAdapter,
useClass: MomentDateAdapter,
deps: [MAT_DATE_LOCALE]
},
{ provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS }
],
bootstrap: [AppComponent]
})
export class AppModule {}angular ionic-framework
I'm new to Ionic and Angular. I'm trying to make a custom component for MatDatepicker. I using this Gihub link as reference but when I tried to implement it, I'm getting Template parse error. I want this custom component to be used in multiple pages. So if anyone can mention what could be the reason for error it would be great. Thanks.
//Error
ERROR Error: Uncaught (in promise): Error: Template parse errors:
'app-date-picker' is not a known element:
1. If 'app-date-picker' is an Angular component, then verify that it is part of this module.
2. If 'app-date-picker' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
<ion-content padding>
[ERROR ->]<app-date-picker placeholder="Enter The First Date" [(ngModel)]="firstDate" format="YYYY/MM/DD HH:mm:"): ng:///TestpagePageModule/TestpagePage.html@7:2
Error: Template parse errors:
'app-date-picker' is not a known element:
1. If 'app-date-picker' is an Angular component, then verify that it is part of this module.
2. If 'app-date-picker' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
<ion-content padding>
[ERROR ->]<app-date-picker placeholder="Enter The First Date" [(ngModel)]="firstDate" format="YYYY/MM/DD HH:mm:"): ng:///TestpagePageModule/TestpagePage.html@7:2//date-picker.component.ts
import { Component, forwardRef, Input } from '@angular/core';
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
import { MatDatepickerInputEvent } from '@angular/material/datepicker';
import * as moment from 'moment';
@Component({
selector: 'app-date-picker',
templateUrl: './date-picker.component.html',
styleUrls: ['./date-picker.component.css'],
providers: [
{
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => DatePickerComponent),
multi: true
}
]
})
export class DatePickerComponent implements ControlValueAccessor {
/**
* Set the value of the date set by user, notice the underscore infront of the datevalue
*/
@Input() _dateValue: string = null;
/**
* Placeholder value for the material control input
*/
@Input() public placeholder: string = null;
/**
* The date format to use with default format but allowing you to pass a custom date format
*/
@Input() private format = 'YYYY/MM/DD HH:mm:ss';
get dateValue() {
return moment(this._dateValue, this.format);
}
set dateValue(val) {
this._dateValue = moment(val).format(this.format);
this.propagateChange(this._dateValue);
}
addEvent(type: string, event: MatDatepickerInputEvent<Date>) {
this.dateValue = moment(event.value, this.format);
}
writeValue(value: any) {
if (value !== undefined) {
this.dateValue = moment(value, this.format);
}
}
propagateChange = (_: any) => {};
registerOnChange(fn) {
this.propagateChange = fn;
}
registerOnTouched() {}
}//app.module.ts
import { DatePickerComponent } from '../app/utility/date-picker/date-picker.component';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import {MomentDateAdapter,MAT_MOMENT_DATE_FORMATS} from '@angular/material-moment-adapter';
import {
MatDatepickerModule,
MatFormFieldModule,
MatInputModule,
DateAdapter,
MAT_DATE_LOCALE,
MAT_DATE_FORMATS
} from '@angular/material';
@NgModule({
declarations: [AppComponent, DatePickerComponent],
entryComponents: ,
imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule,
BrowserModule,
FormsModule,
ReactiveFormsModule,
BrowserAnimationsModule,
MatDatepickerModule,
MatInputModule,
MatFormFieldModule],
providers: [
StatusBar,
SplashScreen,
{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy },
{
provide: DateAdapter,
useClass: MomentDateAdapter,
deps: [MAT_DATE_LOCALE]
},
{ provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS }
],
bootstrap: [AppComponent]
})
export class AppModule {}//Error
ERROR Error: Uncaught (in promise): Error: Template parse errors:
'app-date-picker' is not a known element:
1. If 'app-date-picker' is an Angular component, then verify that it is part of this module.
2. If 'app-date-picker' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
<ion-content padding>
[ERROR ->]<app-date-picker placeholder="Enter The First Date" [(ngModel)]="firstDate" format="YYYY/MM/DD HH:mm:"): ng:///TestpagePageModule/TestpagePage.html@7:2
Error: Template parse errors:
'app-date-picker' is not a known element:
1. If 'app-date-picker' is an Angular component, then verify that it is part of this module.
2. If 'app-date-picker' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
<ion-content padding>
[ERROR ->]<app-date-picker placeholder="Enter The First Date" [(ngModel)]="firstDate" format="YYYY/MM/DD HH:mm:"): ng:///TestpagePageModule/TestpagePage.html@7:2//date-picker.component.ts
import { Component, forwardRef, Input } from '@angular/core';
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
import { MatDatepickerInputEvent } from '@angular/material/datepicker';
import * as moment from 'moment';
@Component({
selector: 'app-date-picker',
templateUrl: './date-picker.component.html',
styleUrls: ['./date-picker.component.css'],
providers: [
{
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => DatePickerComponent),
multi: true
}
]
})
export class DatePickerComponent implements ControlValueAccessor {
/**
* Set the value of the date set by user, notice the underscore infront of the datevalue
*/
@Input() _dateValue: string = null;
/**
* Placeholder value for the material control input
*/
@Input() public placeholder: string = null;
/**
* The date format to use with default format but allowing you to pass a custom date format
*/
@Input() private format = 'YYYY/MM/DD HH:mm:ss';
get dateValue() {
return moment(this._dateValue, this.format);
}
set dateValue(val) {
this._dateValue = moment(val).format(this.format);
this.propagateChange(this._dateValue);
}
addEvent(type: string, event: MatDatepickerInputEvent<Date>) {
this.dateValue = moment(event.value, this.format);
}
writeValue(value: any) {
if (value !== undefined) {
this.dateValue = moment(value, this.format);
}
}
propagateChange = (_: any) => {};
registerOnChange(fn) {
this.propagateChange = fn;
}
registerOnTouched() {}
}//app.module.ts
import { DatePickerComponent } from '../app/utility/date-picker/date-picker.component';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import {MomentDateAdapter,MAT_MOMENT_DATE_FORMATS} from '@angular/material-moment-adapter';
import {
MatDatepickerModule,
MatFormFieldModule,
MatInputModule,
DateAdapter,
MAT_DATE_LOCALE,
MAT_DATE_FORMATS
} from '@angular/material';
@NgModule({
declarations: [AppComponent, DatePickerComponent],
entryComponents: ,
imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule,
BrowserModule,
FormsModule,
ReactiveFormsModule,
BrowserAnimationsModule,
MatDatepickerModule,
MatInputModule,
MatFormFieldModule],
providers: [
StatusBar,
SplashScreen,
{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy },
{
provide: DateAdapter,
useClass: MomentDateAdapter,
deps: [MAT_DATE_LOCALE]
},
{ provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS }
],
bootstrap: [AppComponent]
})
export class AppModule {}//Error
ERROR Error: Uncaught (in promise): Error: Template parse errors:
'app-date-picker' is not a known element:
1. If 'app-date-picker' is an Angular component, then verify that it is part of this module.
2. If 'app-date-picker' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
<ion-content padding>
[ERROR ->]<app-date-picker placeholder="Enter The First Date" [(ngModel)]="firstDate" format="YYYY/MM/DD HH:mm:"): ng:///TestpagePageModule/TestpagePage.html@7:2
Error: Template parse errors:
'app-date-picker' is not a known element:
1. If 'app-date-picker' is an Angular component, then verify that it is part of this module.
2. If 'app-date-picker' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
<ion-content padding>
[ERROR ->]<app-date-picker placeholder="Enter The First Date" [(ngModel)]="firstDate" format="YYYY/MM/DD HH:mm:"): ng:///TestpagePageModule/TestpagePage.html@7:2//date-picker.component.ts
import { Component, forwardRef, Input } from '@angular/core';
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
import { MatDatepickerInputEvent } from '@angular/material/datepicker';
import * as moment from 'moment';
@Component({
selector: 'app-date-picker',
templateUrl: './date-picker.component.html',
styleUrls: ['./date-picker.component.css'],
providers: [
{
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => DatePickerComponent),
multi: true
}
]
})
export class DatePickerComponent implements ControlValueAccessor {
/**
* Set the value of the date set by user, notice the underscore infront of the datevalue
*/
@Input() _dateValue: string = null;
/**
* Placeholder value for the material control input
*/
@Input() public placeholder: string = null;
/**
* The date format to use with default format but allowing you to pass a custom date format
*/
@Input() private format = 'YYYY/MM/DD HH:mm:ss';
get dateValue() {
return moment(this._dateValue, this.format);
}
set dateValue(val) {
this._dateValue = moment(val).format(this.format);
this.propagateChange(this._dateValue);
}
addEvent(type: string, event: MatDatepickerInputEvent<Date>) {
this.dateValue = moment(event.value, this.format);
}
writeValue(value: any) {
if (value !== undefined) {
this.dateValue = moment(value, this.format);
}
}
propagateChange = (_: any) => {};
registerOnChange(fn) {
this.propagateChange = fn;
}
registerOnTouched() {}
}//app.module.ts
import { DatePickerComponent } from '../app/utility/date-picker/date-picker.component';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import {MomentDateAdapter,MAT_MOMENT_DATE_FORMATS} from '@angular/material-moment-adapter';
import {
MatDatepickerModule,
MatFormFieldModule,
MatInputModule,
DateAdapter,
MAT_DATE_LOCALE,
MAT_DATE_FORMATS
} from '@angular/material';
@NgModule({
declarations: [AppComponent, DatePickerComponent],
entryComponents: ,
imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule,
BrowserModule,
FormsModule,
ReactiveFormsModule,
BrowserAnimationsModule,
MatDatepickerModule,
MatInputModule,
MatFormFieldModule],
providers: [
StatusBar,
SplashScreen,
{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy },
{
provide: DateAdapter,
useClass: MomentDateAdapter,
deps: [MAT_DATE_LOCALE]
},
{ provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS }
],
bootstrap: [AppComponent]
})
export class AppModule {}angular ionic-framework
angular ionic-framework
asked Nov 12 at 15:49
Somnath Pal
61511128
61511128
This error suggests that imports are not done correctly. Try adding DatePickerComponent to entry components. I don;t recall what is canonical way to add a component to ionic though
– Sergey Rudenko
Nov 12 at 16:33
Should it be added to declarations or entryComponents or both?
– Somnath Pal
Nov 12 at 16:39
add a comment |
This error suggests that imports are not done correctly. Try adding DatePickerComponent to entry components. I don;t recall what is canonical way to add a component to ionic though
– Sergey Rudenko
Nov 12 at 16:33
Should it be added to declarations or entryComponents or both?
– Somnath Pal
Nov 12 at 16:39
This error suggests that imports are not done correctly. Try adding DatePickerComponent to entry components. I don;t recall what is canonical way to add a component to ionic though
– Sergey Rudenko
Nov 12 at 16:33
This error suggests that imports are not done correctly. Try adding DatePickerComponent to entry components. I don;t recall what is canonical way to add a component to ionic though
– Sergey Rudenko
Nov 12 at 16:33
Should it be added to declarations or entryComponents or both?
– Somnath Pal
Nov 12 at 16:39
Should it be added to declarations or entryComponents or both?
– Somnath Pal
Nov 12 at 16:39
add a comment |
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53265639%2fadd-custom-component-to-ionic-page%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53265639%2fadd-custom-component-to-ionic-page%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
This error suggests that imports are not done correctly. Try adding DatePickerComponent to entry components. I don;t recall what is canonical way to add a component to ionic though
– Sergey Rudenko
Nov 12 at 16:33
Should it be added to declarations or entryComponents or both?
– Somnath Pal
Nov 12 at 16:39