如何将ex.js文件导入ex.component.ts?

问题描述 投票:0回答:1
 import { jsFile } from '../about/ex1.js';
 constructor() {
  jsFile(); // Method
  }

jsFile position img

我在控制台error console img中有错误

javascript typescript console angular6
1个回答
0
投票
 -- In ex1.js --
 export function isFile() {
   // Code
 }

 -- In AboutComponent --
 import { jsFile } from '../about/ex1.js';

 constructor() {
   jsFile(); // Method
 }

尝试导出isFile

© www.soinside.com 2019 - 2024. All rights reserved.