October 2017
Intermediate to advanced
280 pages
6h 50m
English
Angular introduced the concept of forward references. It is required because of the following reasons:
In this section, we will explain the problem that forward references solve and the way we can take advantage of them.
Now, let's suppose that we have defined the Buffer and Socket classes in the opposite order:
// ch6/injector-basics/forward-ref/app.ts @Injectable() class Socket { constructor(private buffer: Buffer) {...} } // undefined console.log(Buffer); class Buffer { constructor(@Inject(BUFFER_SIZE) private size: Number) {...} } // [Function: Buffer] console.log(Buffer); ...Read now
Unlock full access