2016-09-17 8 views
0

私のプロジェクトは最新のAngularコードを持っていないようですが、その理由はわかりません。私のプロジェクトが間違ったAngularバージョンをインストールしているのはなぜですか?

この私のpackage.json

"devDependencies": { 
    "@angular/common": "2.0.0", 
    "@angular/compiler": "2.0.0", 
    "@angular/core": "2.0.0", 
    "@angular/forms": "2.0.0", 
    "@angular/http": "2.0.0", 

にこれはAngular GitHub repositoryで、私はこれが(活字体で)同じ機能ですthis problem

function componentModuleUrl(reflector, type, cmpMetadata) { 
    if (cpl.isStaticSymbol(type)) { 
     return staticTypeModuleUrl(type); 
    } 
    if (isPresent(cmpMetadata.moduleId)) { 
     var moduleId = cmpMetadata.moduleId; 
     var scheme = getUrlScheme(moduleId); 
     return isPresent(scheme) && scheme.length > 0 ? moduleId : 
      "package:" + moduleId + MODULE_SUFFIX; 
    } 
    return reflector.importUri(type); 
} 

を修正するパッチを適用する必要があり、私のにおける関数であります

function componentModuleUrl(
    reflector: ReflectorReader, type: Type<any>, cmpMetadata: Component): string { 
    if (cpl.isStaticSymbol(type)) { 
    return staticTypeModuleUrl(type); 
    } 

    const moduleId = cmpMetadata.moduleId; 

    if (typeof moduleId === 'string') { 
    const scheme = getUrlScheme(moduleId); 
    return scheme ? moduleId : `package:${moduleId}${MODULE_SUFFIX}`; 
    } else if (moduleId !== null && moduleId !== void 0) { 
    throw new Error(
     `moduleId should be a string in "${stringify(type)}". See <shortened link that stackoverflow does not allow> for more information.\n` + 
     `If you're using Webpack you should inline the template and the styles, see <shortened link that stackoverflow does not allow>`); 
    } 

    return reflector.importUri(type); 
} 

答えて

1

正しいバージョンをお勧めします。あなただけの正しいタグに

https://github.com/angular/angular/blob/2.0.0/modules/%40angular/compiler/src/metadata_resolver.ts#L736 enter image description here

+0

感謝を選択する必要があります。私はそれをする方法を知らない。しかし、私はこれらの推測が '' @ angular/common '"2.0.0#2.0.0" '、' '@ angular/common": "git://angular /angular.git#2.0.0 "、" @ angle/common ":" git://github.com/angular/angular.git#2.0.0 "' –

+0

Nevermind。これはうまくいきました: '' @ angular/common ': "angle/angular#2.0.0" –

関連する問題