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.
- either have export
componenthandler
manuallymaterial.js
file &import/require
in component file - or, if using bundler webpack, can make use of exports-loader & use
import/require
exportcomponenthandler
i have given detailed description here so/material design lite reactjs (import/require issue)
hope helps!
Comments
Post a Comment