代码之家  ›  专栏  ›  技术社区  ›  Lorraine Ram-El

在用NativeScript和Typescript编写代码时可以删除.js文件吗

  •  1
  • Lorraine Ram-El  · 技术社区  · 7 年前

    我正在用NativeScript编写一个应用程序,使用Typescript和Angular。

    奇怪的事情发生了-突然我在main.ts文件中编写的代码对应用程序没有任何影响。我查看了-运行后相应的main.js文件没有更改' tns build ios/android tns run ios/android '.

    所以我想问-既然在NativeScript中编写时-每个.ts文件都被“翻译”为.js文件-删除相应的main.js文件以便创建新的更新的main.js文件安全吗?

    1 回复  |  直到 7 年前
        1
  •  0
  •   Lorraine Ram-El    7 年前

    作为

    所以我解决这个问题的方法是这样做“硬重置”:

    1. 关闭所有终端窗口和线程。
      1. 删除 node_modules hook platforms
      2. 选择“Hardware->重置xCode模拟器;删除所有内容和设置”(有关此内容的详细信息,请参阅: How do I reset the Simulator in Xcode 9 )
      3. 关闭AVD模拟器并擦除其数据。
      4. 重置mac(我在同一个会话中几乎两个月没有重置)。
      5. 使用以下方法从头安装新项目:
    tns create ns-audio11 --template tns-template-hello-world-ts
    
    cd ns-audio11
    
    tns platform add android
    
    tns platform add iOS
    
    tns run android
    
    tns run ios
    
    code .
    

    推荐文章