Internal Module does not work if it has an import statement before it

后端 未结 1 523
野趣味
野趣味 2021-01-28 23:05

I am trying to change from using external (export) modules, to using internal modules. But I am getting an error when I remove the \"export\".

I have a fil

相关标签:
1条回答
  • 2021-01-28 23:30

    On the whole, it is best to avoid mixing internal and external modules.

    External modules (or modules as they are now known) are actually rather graceful, and you can organise your code really well without internal modules (or namespaces as they are now known).

    box.ts:

    import {computedFrom} from 'aurelia-framework';
    
    export class Box  { .. Stuff }
    

    service-actions.ts:

    import {Box} from './box'
    
    var box = new Box();
    
    0 讨论(0)
提交回复
热议问题