![](https://img.laitimes.com/img/__Qf2AjLwojIjJCLyojI0JCLicmbw5SZyQDZiZTYlNmN4QGOjFWY2YGZ0IjN2UjM5gjM3MzNz8CX5d2bs92Yl1iclB3bsVmdlR2LcNWaw9CXt92Yu4GZjlGbh5yYjV3Lc9CX6MHc0RHaiojIsJye.png)
(1) TypeScript里的构造函数,对应JavaScript里的ShippingComponent构造函数。
(2) TypeScript里的ngOnInit Hook,对应JavaScript里的原型链上的ShippingComponent.prototype.ngOnInit.
(3) TypeScript里的@Component注解(或者叫装饰器decorator),对应JavaScript变量__decorate指向的函数。
最后,从@angular/core导入的core_1.Component, 经过装饰器函数__decorate处理之后,返回ShippingComponent,被赋给exports的ShippingComponent属性,这样其他Component就可以通过import导入这个Component了。