A very basic starter template with fundamental HTML5 markup -- only the basics.
Based on HTML5 Bones | http://html5bones.com
| import {PipeTransform, Pipe} from 'angular2/core'; | |
| @Pipe({ name: 'highlight' }) | |
| export class HighLightPipe implements PipeTransform { | |
| transform(text: string, [search]): string { | |
| return search ? text.replace(new RegExp(search, 'i'), `<span class="highlight">${search}</span>`) : text; | |
| } | |
| } | |
| /** Usage: |
| <!-- | |
| interface Organization { | |
| name: string; | |
| url: string; | |
| children: Organization[]; | |
| } | |
| org: Organization[]; | |
| --> | |
| <div class="invid-tree"> | |
| <ng-template #recursiveList let-list> |
| import { | |
| HttpInterceptor, | |
| HttpRequest, | |
| HttpResponse, | |
| HttpHandler, | |
| HttpEvent | |
| } from '@angular/common/http'; | |
| import 'rxjs/add/operator/map'; | |
| @Injectable() |
A very basic starter template with fundamental HTML5 markup -- only the basics.
Based on HTML5 Bones | http://html5bones.com