gpt4 book ai didi

visual studio 2015 中的 typescript 调试不再适用于 Angular 2 2.0.0-rc.1

转载 作者:太空狗 更新时间:2023-10-29 17:29:04 24 4
gpt4 key购买 nike

升级到 Angular 2 rc1 之后,visual studio 2015 中的 typescript 调试停止工作。我在以前的版本中添加了元标记,但这会导致所有其他类型的问题,现在关于“要求”未定义。有没有人能让它正常工作?

这是我的 system.config.js 文件

(function (global) {

// map tells the System loader where to look for things
var map = {
'app': 'app', // 'dist',
'rxjs': 'node_modules/rxjs',
'@angular': 'node_modules/@angular'
};

// packages tells the System loader how to load when no filename
// and/or no extension
var packages = {
'app': { main: 'main.js', defaultExtension: 'js' },
'rxjs': { defaultExtension: 'js' },
};
var meta = {
'*.js': { scriptLoad: true } //this allows TS debugging in VS
};

var packageNames = [
'@angular/common',
'@angular/compiler',
'@angular/core',
'@angular/http',
'@angular/platform-browser',
'@angular/platform-browser-dynamic',
'@angular/router',
'@angular/router-deprecated',
'@angular/testing',
'@angular/upgrade',
];

// add package entries for angular packages in
// the form '@angular/common': { main: 'index.js',
// defaultExtension: 'js' }
packageNames.forEach(function (pkgName) {
packages[pkgName] = { main: 'index.js', defaultExtension: 'js' };
});

var config = {
meta: meta,
map: map,
packages: packages
}

// filterSystemConfig - index.html's chance to modify config before
// we register it.
if (global.filterSystemConfig) { global.filterSystemConfig(config); }

System.config(config);

})(this);

最佳答案

解决方法是在 cmd 中为您的项目文件夹运行以下命令

>tsc

但首先要确保你已经安装了 typescript 编译器

$ npm install typescript-compiler 

关于visual studio 2015 中的 typescript 调试不再适用于 Angular 2 2.0.0-rc.1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37032701/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com