為了能讓大家能夠順利的建立起 Angular 18 開發環境,以下是需要安裝的相關軟體與安裝步驟與說明。
- Windows 10 以上版本
- Mac OS X 10.6 以上版本
| <h1>Angular 2 Recursive List</h1> | |
| <ul> | |
| <ng-template #recursiveList let-list> | |
| <li *ngFor="let item of list"> | |
| {{item.title}} | |
| <ul *ngIf="item.children.length > 0"> | |
| <ng-container *ngTemplateOutlet="recursiveList; context:{ $implicit: item.children }"></ng-container> | |
| </ul> | |
| </li> | |
| </ng-template> |
| Number.prototype.pad = function(size) { | |
| var s = String(this); | |
| while (s.length < (size || 2)) {s = "0" + s;} | |
| return s; | |
| } | |
| (1).pad(3) // => "001" | |
| (10).pad(3) // => "010" | |
| (100).pad(3) // => "100" |
In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.
For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.