tng / ngx-structurals Goto Github PK
View Code? Open in Web Editor NEWStructural utility directives for Angular
License: MIT License
Structural utility directives for Angular
License: MIT License
Given that isLoading$: Observable<boolean>
.
Then as isLoading
in the below template is inferred as type false | true | null
. But it can never be null
.
<ng-container *ngxAlias="(isLoading$ | async) === true as isLoading"></ng-container>
I'm reporting this here because *ngIf
seems to work.
Not sure if the problem is with *ngxAlias
or the Angular Language Service
Getting this type error when running with "angularCompilerOptions": { "strictTemplates": true }
ERROR in src/app/components/side-menu/side-menu.component.html:11:15 - error TS2322: Type 'string' is not assignable to type 'Observable<boolean>'.
11 <ng-container *ngxSubscribe="let isSideMenuCollapsed of isSideMenuCollapsed$">
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Component
export class SideMenuComponent {
// type is Observable<boolean> and is coming from an Akita query
public readonly isSideMenuCollapsed$ = this.sideMenuQuery.isSideMenuCollapsed$;
...
}
HTML
<ng-container *ngxSubscribe="let isSideMenuCollapsed of isSideMenuCollapsed$">
...
</ng-container>
UPDATE
This works
<ng-container *ngxAlias="isSideMenuCollapsed$ | async as isSideMenuCollapsed">
Perhaps it's not related to strictTemplates but me misunderstanding ngxSubscribe
*ngxRange="let value from 0 to 7 by 2"
Let's see if this would even ever be useful.
ngx-structurals/projects/ngx-structurals/package.json
Lines 19 to 20 in 8bc6f25
Angular 12 appears to work. Can it get added to the supported version list?
The README is currently on root level so Github can read it, but for npm we need to copy it into the dist folder before publishing.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.