Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 521
6324 Avatar asked Jul 21 '16 16:07

6324


1 Answers

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.

like image 112
Wassim Chegham Avatar answered Oct 15 '22 00:10

Wassim Chegham