angular - "has no exported member" Error in my MTL module -


:grinning: me ? have class mdl : materialdesignliteupgradeelements.ts

import {directive, afterviewinit} 'angular2/core'; declare var componenthandler; @directive({     selector: '[mdl]' }) export class mdl implements afterviewinit {     ngafterviewinit() {         componenthandler.upgradeallregistered();     } } 

and following stack post : material design lite tooltips not working angular 2 added :

 ngafterviewinit() {     componenthandler.upgradedom();   } 

in class managing view using mtl :

materialdesignliteupgradeelements has no exported member "componenthandler" 

the console error :

exception: typeerror: cannot read property 'upgradedom' of undefined 

any ideas ?

i not angular2 but, faced same issue in reactjs material design lite (mdl).

the reason why getting exception: typeerror: cannot read property 'upgradedom' of undefined error mdl not export module default. can follow below suggestions export module.

  1. either have export componenthandler manually material.js file & import/require in component file
  2. or, if using bundler webpack, can make use of exports-loader & use import/require export componenthandler

i have given detailed description here so/material design lite reactjs (import/require issue)

hope helps!


Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -