{"action":"closed","issue":{"url":"https://api.github.com/repos/angular/angular/issues/3807","labels_url":"https://api.github.com/repos/angular/angular/issues/3807/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular/issues/3807/comments","events_url":"https://api.github.com/repos/angular/angular/issues/3807/events","html_url":"https://github.com/angular/angular/issues/3807","id":102810008,"number":3807,"title":"Pipe is called three times","user":{"login":"danicomas","id":4038192,"avatar_url":"https://avatars.githubusercontent.com/u/4038192?v=3","gravatar_id":"","url":"https://api.github.com/users/danicomas","html_url":"https://github.com/danicomas","followers_url":"https://api.github.com/users/danicomas/followers","following_url":"https://api.github.com/users/danicomas/following{/other_user}","gists_url":"https://api.github.com/users/danicomas/gists{/gist_id}","starred_url":"https://api.github.com/users/danicomas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danicomas/subscriptions","organizations_url":"https://api.github.com/users/danicomas/orgs","repos_url":"https://api.github.com/users/danicomas/repos","events_url":"https://api.github.com/users/danicomas/events{/privacy}","received_events_url":"https://api.github.com/users/danicomas/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/angular/angular/labels/comp:%20core/change_detection","name":"comp: core/change_detection","color":"c7def8"},{"url":"https://api.github.com/repos/angular/angular/labels/effort2:%20medium%20(day)","name":"effort2: medium (day)","color":"bfe5bf"},{"url":"https://api.github.com/repos/angular/angular/labels/P2:%20required","name":"P2: required","color":"fad8c7"},{"url":"https://api.github.com/repos/angular/angular/labels/type:%20bug","name":"type: bug","color":"EEEEEE"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-08-24T14:44:34Z","updated_at":"2015-10-08T10:07:36Z","closed_at":"2015-10-08T10:07:36Z","body":"I have created this Pipe:\r\n\r\n```js\r\n@Pipe({name: 'capitalize'})\r\nexport class CapitalizePipe {  \r\n  capitalize(value) {\r\n    return value.charAt(0).toUpperCase() + value.slice(1);\r\n  } \r\n  \r\n  transform(value):string {\r\n    return this.capitalize(value);\r\n  }\r\n}\r\n```\r\n\r\nAnd added in these components:\r\n\r\n```js\r\n@Component({selector: 'input-text', properties: ['controlPath: control', 'value: data']})\r\n@View({\r\n  template: `\r\n    <div class=\"form-group\">\r\n      <label [attr.for]=\"controlPath\">{{controlPath | capitalize}}</label>\r\n      <input type=\"text\" class=\"form-control\" [id]=\"controlPath\" [placeholder]=\"controlPath\" [(ng-model)]=\"value\">\r\n      <show-error control=\"{{controlPath}}\" [errors]=\"['required']\"></show-error>\r\n    </div>\r\n  `,\r\n  directives: [ShowError, FORM_DIRECTIVES],\r\n  pipes: [CapitalizePipe]\r\n})\r\nclass InputText {\r\n  controlPath: string;\r\n  value: string;\r\n\r\n  constructor() { }\r\n}\r\n```\r\n\r\n```js\r\n@Component({\r\n  selector: 'my-app',\r\n  viewBindings: [HTTP_BINDINGS]\r\n})\r\n@View({\r\n  template: \r\n  `<form (ng-submit)=\"onSubmit(form)\" [ng-form-model]='form'>\r\n    <img [src]=\"data.avatar_url ? data.avatar_url : ''\" width=\"100\" height=\"100\"/>\r\n    <input-text control=\"name\" [data]=\"data.name\"></input-text> \r\n    <input type=\"submit\" class=\"btn btn-primary\"/>\r\n  </form>`,\r\n  directives: [FORM_DIRECTIVES, ShowError, NgIf, InputText]\r\n})\r\n\r\n// Component controller\r\nclass MyAppComponent {\r\n  data: Object;\r\n  form:ControlGroup;\r\n  constructor(@Inject(Http) http:Http) {\r\n    this.data = {};\r\n\t  this.form = new ControlGroup({\r\n      name: new Control(\"\", Validators.required)\r\n    });\r\n    http.get('https://api.github.com/users/danicomas').toRx().map(res => res.json()).subscribe(response => this.data = response);\r\n  }\r\n  \r\n  onSubmit(f) {\r\n    console.log(f);\r\n    console.log(f.controls.name.valid);\r\n    console.log(this.data);\r\n  }\r\n}\r\n\r\nbootstrap(MyAppComponent);\r\n```\r\n\r\nThen I have debugged the transform pipe function and it is called 3 times :S\r\n"}}