|
137 | 137 | |129| [What is a DI token?](#what-is-a-di-token)|
|
138 | 138 | |130| [What is Angular DSL?](#what-is-angular-dsl)|
|
139 | 139 | |131| [What is an rxjs Subject?](#what-is-an-rxjs-Subject)|
|
140 |
| - |
141 |
| - |
| 140 | +|132| [What is Bazel tool?](#what-is-bazel-tool)| |
| 141 | +|133| [What are the advantages of Bazel tool?](#what-are-the-advantages-of-bazel-tool)| |
| 142 | +|134| [How do you use Bazel with Angular CLI?](#how-do-you-use-bazel-with-angular-cli)| |
| 143 | +|135| [How do you run Bazel directly?](#how-do-you-run-bazel-directly)| |
142 | 144 |
|
143 | 145 | 1. ### What is Angular Framework?
|
144 | 146 |
|
|
1681 | 1683 | 2. []: Used for Input and specific DOM element attributes.
|
1682 | 1684 | 3. * : Structural directives(*ngFor or *ngIf) will affect/change the DOM structure.
|
1683 | 1685 | 131. ### what is an rxjs subject in Angular
|
1684 |
| - An RxJS Subject is a special type of Observable that allows values to be multicasted to many Observers. While plain Observables are unicast (each subscribed Observer owns an independent execution of the Observable), Subjects are multicast. |
| 1686 | + An RxJS Subject is a special type of Observable that allows values to be multicasted to many Observers. While plain Observables are unicast (each subscribed Observer owns an independent execution of the Observable), Subjects are multicast. |
1685 | 1687 |
|
1686 |
| - A Subject is like an Observable, but can multicast to many Observers. Subjects are like EventEmitters: they maintain a registry of many listeners. |
1687 |
| - ``` typescript |
| 1688 | + A Subject is like an Observable, but can multicast to many Observers. Subjects are like EventEmitters: they maintain a registry of many listeners. |
| 1689 | + ``` typescript |
1688 | 1690 | import { Subject } from 'rxjs';
|
1689 | 1691 |
|
1690 | 1692 | const subject = new Subject<number>();
|
|
1698 | 1700 |
|
1699 | 1701 | subject.next(1);
|
1700 | 1702 | subject.next(2);
|
1701 |
| - ``` |
| 1703 | + ``` |
| 1704 | +132. ### What is Bazel tool? |
| 1705 | + Bazel is a powerful build tool developed and massively used by Google and it can keep track of the dependencies between different packages and build targets. In Angular8, you can build your CLI application with Bazel. |
| 1706 | + **Note:** The Angular framework itself is built with Bazel. |
| 1707 | +133. ### What are the advantages of Bazel tool? |
| 1708 | + Below are the list of key advantages of Bazel tool, |
| 1709 | + 1. It creates the possibility of building your back-ends and front-ends with the same tool |
| 1710 | + 2. The incremental build and tests |
| 1711 | + 3. It creates the possibility to have remote builds and cache on a build farm. |
| 1712 | +
|
| 1713 | +134. ### How do you use Bazel with Angular CLI? |
| 1714 | + The @angular/bazel package provides a builder that allows Angular CLI to use Bazel as the build tool. |
| 1715 | + 1. **Use in an existing applciation:** Add @angular/bazel using CLI |
| 1716 | + ```javascript |
| 1717 | + ng add @angular/bazel |
| 1718 | + ``` |
| 1719 | + 2. **Use in a new application:** Install the package and create the application with collection option |
| 1720 | + ```javascript |
| 1721 | + npm install -g @angular/bazel |
| 1722 | + ng new --collection=@angular/bazel |
| 1723 | + ``` |
| 1724 | + When you use ng build and ng serve commands, Bazel is used behind the scenes and outputs the results in dist/bin folder. |
| 1725 | +
|
| 1726 | +135. ### How do you run Bazel directly? |
| 1727 | + Sometimes you may want to bypass the Angular CLI builder and run Bazel directly using Bazel CLI. You can install it globally using @bazel/bazel npm package. i.e, Bazel CLI is available under @bazel/bazel package. After you can apply the below common commands, |
| 1728 | + ```javascrippt |
| 1729 | + bazel build [targets] // Compile the default output artifacts of the given targets. |
| 1730 | + bazel test [targets] // Run the tests with *_test targets found in the pattern. |
| 1731 | + bazel run [target]: Compile the program represented by target and then run it. |
| 1732 | + ``` |
0 commit comments