Search code examples
angularjsintellij-ideaecmascript-6phpstormwebstorm

default export is not declared in imported module


I am using ES6 in IntelliJ IDEA. Below is a piece of code.

import controller from './tpmInfo.ctrl.js'
import template from './tpmInfo.tpl.html' //default export is not declared in imported module

export default angular.module('tmpApp', [])
    .component('tpmInfo', {
        template: template,
        controller: controller,
        bindings: {
            ags: '='
        }
    })
.name;

The template html is a normal html, but IntelliJ IDEA throws warning "default export is not declared in imported module". Is there any way to make this warning disappear? Thanks.


Solution

  • try this:

    import * as tpl from './tpmInfo.tpl.html'
    

    and then use it like this:

    template: tpl.template,
    

    Let me know if this works for you.