File tree Expand file tree Collapse file tree 3 files changed +26
-9
lines changed
projects/template-type-checker Expand file tree Collapse file tree 3 files changed +26
-9
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) ,
66and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
77
8+ ## [ 1.0.0-rc.2] - 2022-08-15
9+
10+ ### Changed
11+
12+ - Sample usage
13+
814## [ 1.0.0-rc.1] - 2022-08-14
915
1016### Added
Original file line number Diff line number Diff line change 1313 - [ NPM] ( #npm )
1414 - [ Usage] ( #usage )
1515 - [ Module Import] ( #module-import )
16- - [ HTML] ( #html )
1716 - [ TS] ( #ts )
17+ - [ HTML] ( #html )
1818
1919## Features
2020
@@ -46,32 +46,43 @@ import { TemplateTypeCheckerModule } from '@ngx-toolset/template-type-checker';
4646export class SampleModule {}
4747```
4848
49- ### HTML
50-
51- ``` angular2html
52- <div *ngIf="sampleObject | typeChecker:classA">
53- </div>
54- ```
55-
5649### TS
5750
5851``` ts
5952import { Component } from ' @angular/core' ;
6053
6154class ClassA {}
6255
56+ class ClassB {}
57+
6358@Component ({
6459 selector: ' app-sample' ,
6560 templateUrl: ' ./sample.component.html' ,
6661 styleUrls: [' ./sample.component.scss' ]
6762})
6863export class ProductAlertsComponent {
6964 public classA: typeof ClassA ;
65+ public classB: typeof ClassB ;
7066 public sampleObject: ClassA ;
7167
7268 public constructor () {
7369 this .classA = ClassA ;
70+ this .classB = ClassB ;
7471 this .sampleObject = new ClassA ();
7572 }
7673}
74+ ```
75+
76+ ### HTML
77+
78+ ``` html
79+ <!-- TypeCheckerPipe returns object of type ClassA -> ngIf evaluates to truthy value -->
80+ <div *ngIf =" sampleObject | typeChecker:classA" >
81+ This div will be rendered.
82+ </div >
83+
84+ <!-- TypeCheckerPipe returns undefined -> ngIf evaluates to falsy value -->
85+ <div *ngIf =" sampleObject | typeChecker:classB" >
86+ This div will not be rendered.
87+ </div >
7788```
Original file line number Diff line number Diff line change 11{
22 "name" : " @ngx-toolset/template-type-checker" ,
3- "version" : " 1.0.0-rc.1 " ,
3+ "version" : " 1.0.0-rc.2 " ,
44 "description" : " Angular template class type check support" ,
55 "homepage" : " https://github.com/SwabianCoder/ngx-toolset" ,
66 "license" : " MIT" ,
You can’t perform that action at this time.
0 commit comments