Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zone.js:355 Unhandled Promise rejection: Template parse errors #115

Open
anil1712 opened this issue Oct 15, 2016 · 15 comments
Open

zone.js:355 Unhandled Promise rejection: Template parse errors #115

anil1712 opened this issue Oct 15, 2016 · 15 comments

Comments

@anil1712
Copy link

Hi,

I am using modal code as per the DOC, but getting below exception.

'modal-content' is not a known element:

  1. If 'modal-content' is an Angular component, then verify that it is part of this module.
  2. 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 ->]
<form class="ui large form" (ngSubmit)="onSubmit()" #loginForm="ngForm" nova"): BannerHeaderComponent@26:4 ; Zone: ; Task: Promise.then ; Value: Error: Template parse errors:(…) Error: Template parse errors:
'modal-content' is not a known element:

  1. If 'modal-content' is an Angular component, then verify that it is part of this module.
  2. If 'modal-content' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schemas' of this component to suppress this message. ("
@comoris
Copy link

comoris commented Oct 15, 2016

+1

@alex88
Copy link

alex88 commented Oct 17, 2016

Same here, is it something new with angular?

@anil1712
Copy link
Author

Yeah, Dont know. Nothing mentioed in DOC.

@alex88
Copy link

alex88 commented Oct 17, 2016

Anyway the CUSTOM_ELEMENTS_SCHEMA fix works, but probably it's just a way to ignore that warning

@anil1712
Copy link
Author

And also how do I change the modal size? I needed small login modal.

@alex88
Copy link

alex88 commented Oct 17, 2016

Probably with a class on the modal

@anil1712
Copy link
Author

Can you please provide any sample block code?

@alex88
Copy link

alex88 commented Oct 17, 2016

<sm-modal title="Hello from Modal" class="small large" #myModal>

@anil1712
Copy link
Author

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 ?

@alex88
Copy link

alex88 commented Oct 18, 2016

In your template

<sm-modal #editSupplierModal>

in your component

import { SemanticModalComponent } from 'ng-semantic';

@ViewChild('editSupplierModal') editSupplierModal: SemanticModalComponent;

...

this.editSupplierModal.show();

@anil1712
Copy link
Author

Thanks, Its working.

@anil1712
Copy link
Author

anil1712 commented Oct 21, 2016

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.

@alex88
Copy link

alex88 commented Oct 22, 2016

@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

@anil1712
Copy link
Author

anil1712 commented Oct 23, 2016

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,

@alex88
Copy link

alex88 commented Oct 23, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants