Angular2 module component giving me error pipe can not be found
{{obj|json}}
Below is the test code and it simply works :
app.component.ts
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
obj : any = ['test1', 'test2', 'test3'];
}
app.component.html
{{ obj | json }}
browser output
[ "test1", "test2", "test3" ]
You can paste the code here, so that we can check where exactly you are missing on pipe.
You can check more information on Jsonpipe here
在我的情况下,它只是重新启动应用程序并且它起作用了。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.