import {Component} from "angular2/core"; import {bootstrap} from "angular2/platform/browser";
@Component({
selector:"ez-app",
template:`
<h1>管道级联</h1>
<p>{{ (text | slice:0:20 | uppercase) + "..." }}</p>
<p>{{ (text1 | slice:0:1 | uppercase) + (text1 | slice:1:4)+ " " + (text1 | slice:5:6 | uppercase) + (text1 | slice:6:12)}}</p>
`
})
class EzApp{
constructor(){
this.text = Next we demonstrate this pipe in a test component
whose template defines two bindings
;
this.text1 = `stay foolish`;
}
}
bootstrap(EzApp);
The output is Stay Foolish, but cannot pass and go to next chapter