2016-08-18 5 views
1

나는 언어로 다트를 사용하여 Angular2 사이트에서 영웅의 투어를 ​​따라 한 내가 대문자 파이프를 사용하려고 할 때 오류가 : 여기Angular2 투어 : 대문자

Build error: 
Transform TemplateCompiler on angular2_tour_of_heroes|lib/heroes_component.ng_meta.json threw error: Template parse errors: 
The pipe 'uppercase' could not be found (" 

<h2>My Heroes</h2> 
    <ul class="heroes"> 
    <li *ngFor="let hero of heroes" 
     [class.selected]="hero == selectedHero" 
     (click)="onSelect(hero)"> 
     <span class="badge">{{hero.id}}</span> {{hero.name}} 
    </li> 
    </ul> 
    <div *ngIf="selectedHero != null"> 
    <h2> {{selectedHero.name | uppercase}} is my hero </h2> 
    <button (click)="gotoDetail()">View Details</button> 
    </div> 

그것은 큰 문제가 아니지만, 내가 이런 일이 이유를 알고 싶습니다 내 heroes_component.html 파일입니다. Linux 용 Pub 버전 1.18.1 및 Dart VM 버전 : 1.18.1을 사용하고 있습니다.

name: angular2_tour_of_heroes 
description: Tour of heroes 
version: 0.0.1 
environment: 
     sdk: '>=1.13.0 <2.0.0' 
dependencies: 
     angular2: 2.0.0-beta.18 
     browser: ^0.10.0 
     dart_to_js_script_rewriter: ^1.0.1 
transformers: 
- angular2: 
    platform_directives: 
    - 'package:angular2/common.dart#COMMON_DIRECTIVES' 
    platform_pipes: 
    - 'package:angular2/common.dart#COMMON_PIPES' 
    entry_points: web/main.dart 
- dart_to_js_script_rewriter 

답변

2

업데이트 Angular2이 beta.18 할 수 있지만 사용할 수는 이미 beta.19이

귀하의 pubspec.yaml 제한 : 완성도를 들어

, 여기 내 pubspec 파일입니다.

당신이

dependencies: 
     angular2: ^2.0.0-beta.18 

에 대한 종속성을 변경하고 pub upgrade를 실행하는 경우에는 최신 버전을 얻을 수 있습니다. 파이프 관련 변경 사항을 알지는 못했지만 시도해 볼 가치가 있습니다 (아래의 설명에 따라 수정 됨).

원래 당신은 commonPipes

+0

내'pubspec' 이미'platform_pipes 포함 - '패키지 : angular2/common.dart 번호의 COMMON_PIPES''을 – glapworth

+1

나는 뭔가 파이프 관련 변경되었지만 베타 버전으로 업데이트하는 시도 가치가있을 수도가 있다고 생각하지 않습니다 .19 –

+1

듣기 좋게 :) 그리고 끝났습니다. –