构建:类&#39;主题<t>&#39;错误地扩展了基类&#39; Observable <t>&#39;

时间:2017-08-10 05:04:00

标签: angular typescript

我收到这样的错误

**Build:Class 'Subject<T>' incorrectly extends base class 'Observable<T>** .

我安装了TypeScript 2.4.1并从git angular quick starter files下载了角度快速启动文件,并将 src文件夹,bs-config.json,package.json,tslint.json文件复制到该项目(我在ASP.NET MVC中创建了一个空模板项目)。在重建的过程中,我收到了这个错误。怎么办?

2 个答案:

答案 0 :(得分:2)

我从控制面板卸载了TypeScript并使用NuGet进行安装。 现在它正在运作。

PM =&gt;安装包Microsoft.TypeScript.Compiler -Version 2.1.5

答案 1 :(得分:0)

该问题已在RxJS中修复,但您应该使用TypeScript 2.4进行编译 用记事本打开.csproj并查找此标记

app.directive('arrowNavigate',['$document',function($document){
    return{
        restrict:'A',
        link:function(scope){

        $document.bind('keydown',function(e){

                if(e.keyCode == 37){
                    console.log(scope.currentSlideIndex);
                    scope.currentSlideIndex = (scope.currentSlideIndex < scope.results.length - 1) ? ++scope.currentSlideIndex : 0;
                    scope.$apply();
                    e.preventDefault();
                }
                if(e.keyCode == 39){
                    console.log(scope.currentSlideIndex);
                    scope.currentSlideIndex = (scope.currentSlideIndex > 0) ? --scope.currentSlideIndex : scope.results.length - 1;
                    scope.$apply();
                    e.preventDefault();
                }

        });
    }
};
}]);

将其更改为并编译。

<typescripttoolsversion>1.8</typescripttoolsversion>
相关问题