question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

mdChip not properly exposing methods from API to parent component

See original GitHub issue

Bug, feature request, or proposal:

Bug

What is the expected behavior?

I’m trying to build a wrapper around the angular material library because there are certain customizations/enhancements that we want to add on top. When writing the wrapper, we pass inputs from the wrapper component to the angular material element. In this case, mdChip.

Expect that the methods from the API can be passed from child to parent component. This is how it currently works for mdSlideToggle.

What is the current behavior?

Methods are not currently being exposed to the parent correctly, and is throwing console errors. Also, not quite sure how to use toggleSelected because it is also throwing console errors.

VM3153 AppComponent.ngfactory.js:97 ERROR TypeError: jit_nodeValue15(...).toggleSelected is not a function
    at Object.eval [as handleEvent] (VM3153 AppComponent.ngfactory.js:101)
    at handleEvent (VM2725 core.umd.js:12079)
    at callWithDebugContext (VM2725 core.umd.js:13538)
    at Object.debugHandleEvent [as handleEvent] (VM2725 core.umd.js:13126)
    at dispatchEvent (VM2725 core.umd.js:8691)
    at eval (VM2725 core.umd.js:9302)
    at HTMLButtonElement.eval (VM2723 platform-browser.umd.js:2702)
    at e.invokeTask (VM2695 zone.min.js:1)
    at Object.onInvokeTask (VM2725 core.umd.js:3956)
    at e.invokeTask (VM2695 zone.min.js:1)
    at n.runTask (VM2695 zone.min.js:1)
    at HTMLButtonElement.invoke (VM2695 zone.min.js:1)

What are the steps to reproduce?

http://plnkr.co/edit/UtI6HF?p=preview

What is the use-case or motivation for changing an existing behavior?

Inconsistency, hard to wrap components and expose inputs

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Using:

Angular 4.0.0, Material 2.0.0-beta.7, MACOSX, TypeScript 2.3.3

probably all browsers

Is there anything else we should know?

First time submitting bug report, please let me know if I’m missing anything for next time. Thanks!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
willshowellcommented, Jun 28, 2017

just import {MdChip} from '@angular/material'

0reactions
angular-automatic-lock-bot[bot]commented, Sep 6, 2019

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

mdChip not properly exposing methods from API to parent ...
When writing the wrapper, we pass inputs from the wrapper component to the angular material element. In this case, mdChip. Expect that the ......
Read more >
API data rendering Issue in Child component in React
The problem could be the API call on the parent is not asynchronous and thus the child could have no data from parent...
Read more >
Directives > mdAutocomplete - AngularJS Material
Parameter Type Description md‑search‑text expression expression A model to bind the search query text to. md‑selected‑item object object A model to bind the selected item...
Read more >
Blog - react-md
@react-md/tooltip: Remove documentation around Tooltipped component ... was mostly targeted around exposing the tooltip's "Hover Mode API" as well as the ...
Read more >
Supplement other js/css files · 13f3a8ea4b - xstatic-angular ...
As an example, see input.js which exposes some animation-related methods. window. ... backdrop uses position:absolute and will not work properly with parent ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found