ngSemantic
ngSemantic copied to clipboard
zone.js:355 Unhandled Promise rejection: Template parse errors
Hi,
I am using modal code as per the DOC, but getting below exception.
'modal-content' is not a known element:
- If 'modal-content' is an Angular component, then verify that it is part of this module.
- If 'modal-content' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schemas' of this component to suppress this message. ("
<sm-modal title="MyForm" #MyForm>
[ERROR ->]
- If 'modal-content' is an Angular component, then verify that it is part of this module.
- If 'modal-content' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schemas' of this component to suppress this message. ("
+1
Same here, is it something new with angular?
Yeah, Dont know. Nothing mentioed in DOC.
Anyway the CUSTOM_ELEMENTS_SCHEMA
fix works, but probably it's just a way to ignore that warning
And also how do I change the modal size? I needed small login modal.
Probably with a class on the modal
Can you please provide any sample block code?
<sm-modal title="Hello from Modal" class="small large" #myModal>
Thanks, the small
is working.
Is anyone knows how to open the modal from angular conponent method. I mean I can provide a method name in click
event but what code I need to write to open any modal ?
In your template
<sm-modal #editSupplierModal>
in your component
import { SemanticModalComponent } from 'ng-semantic';
@ViewChild('editSupplierModal') editSupplierModal: SemanticModalComponent;
...
this.editSupplierModal.show();
Thanks, Its working.
How to pass data
in modal?
I want to show dynamic data in modal. Is there any way to pass variables while showing the data.
Like I want to bind the modal inside the *ngFor loop and want to show dynamic data in modal.
@anil1712 the modal is in the same scope as the main template, so you can use the same values you use in the component that includes the modal, otherwise, if you create a custom component for the modal, you pass data the same way you do with any other component
Hi @alex88 ,
I have created new component for modal. So I need to share data from one component to another. I am using @angular/common": "~2.1.0
. So can you please share me any link or send me any block of code to pass data from one component to another. Actually I am pretty new for angular2. Please help me to out of it.
Thanks,
Me too, so I don't really know what's the best way, maybe using input/outputs https://angular.io/docs/ts/latest/cookbook/component-communication.html