Does ngStyle/ngClass support `lt-xx` `gt-xx` postfix?
In my test it does not work but I do not see any statement that it should not work.
<div style="padding-top: 1em;"
ngStyle.gt-lg="width: 'calc(33.33% - 15px)'; 'padding-top': '1em';"
[style.md]="{width: 'calc(50% - 15px)'}"
[style.sm]="{width: 'calc(100% - 15px)'}"
[style.xs]="{width: 'calc(100% - 15px)'}"></div>
See https://github.com/angular/flex-layout/blob/master/src/lib/flexbox/api/style.ts#L86-L100.
@Input('style.xs') set styleXs(val: NgStyleType) { this._base.cacheInput('styleXs', val, true); }
@Input('style.sm') set styleSm(val: NgStyleType) { this._base.cacheInput('styleSm', val, true); };
@Input('style.md') set styleMd(val: NgStyleType) { this._base.cacheInput('styleMd', val, true);};
@Input('style.lg') set styleLg(val: NgStyleType) { this._base.cacheInput('styleLg', val, true); };
@Input('style.xl') set styleXl(val: NgStyleType) { this._base.cacheInput('styleXl', val, true); };
@Input('style.lt-sm') set styleLtSm(val: NgStyleType) { this._base.cacheInput('styleLtSm', val, true); };
@Input('style.lt-md') set styleLtMd(val: NgStyleType) { this._base.cacheInput('styleLtMd', val, true); };
@Input('style.lt-lg') set styleLtLg(val: NgStyleType) { this._base.cacheInput('styleLtLg', val, true);};
@Input('style.lt-xl') set styleLtXl(val: NgStyleType) { this._base.cacheInput('styleLtXl', val, true); };
@Input('style.gt-xs') set styleGtXs(val: NgStyleType) { this._base.cacheInput('styleGtXs', val, true); };
@Input('style.gt-sm') set styleGtSm(val: NgStyleType) { this._base.cacheInput('styleGtSm', val, true); };
@Input('style.gt-md') set styleGtMd(val: NgStyleType) { this._base.cacheInput('styleGtMd', val, true);};
@Input('style.gt-lg') set styleGtLg(val: NgStyleType) { this._base.cacheInput('styleGtLg', val, true); };
This should be working. Please provide a Plunkr that demonstrates it not working.
Make sure you are using the latest code from HEAD builds: see Install from NPM @angular/flex-layout HEAD
Closing as not-an-issue.
Hello Guys!! I am really in trouble with this. I user this Dependencies: "@angular/animations": "4.1.3", "@angular/common": "4.1.3", "@angular/compiler": "^4.1.3", "@angular/core": "^4.1.3", "@angular/flex-layout": "^2.0.0-beta.10", "@angular/forms": "^4.1.3", "@angular/http": "4.1.3", "@angular/platform-browser": "4.1.3", "@angular/platform-browser-dynamic": "4.1.3", "@angular/platform-server": "4.1.3", "@angular/router": "4.1.3",
"devDependencies": { "@angular/cli": "^1.5.0", "@angular/compiler-cli": "4.1.3",
As you see i use "@angular/flex-layout": "^2.0.0-beta.10", i simple i CAN`T use [ngStyle.lt-sm]="'min-height: 800px;'"
My console.log is:
Can't bind to 'ngStyle.lt-sm' since it isn't a known property of 'div'. ("<div class="box-container" fxLayout="column" [ERROR ->][ngStyle.lt-sm]="'min-height: 800px;'">
i can still use style="min-height: 800px", etc... but this solution dosnt give the reponsive feature to my system.
I use angular to be responsive and all platforms (as well).... So what should i do Guys?? Any one please can help me? Have a nice day if u read all....!
hello @Juliozen were you able to resolve the issue that you had, I am facing a similar issue now. Below are my dependencies
"dependencies": {
"@angular-devkit/core": "^0.2.0",
"@angular/animations": "^5.0.1",
"@angular/cdk": "5.0.0-rc.3",
"@angular/common": "^5.0.1",
"@angular/compiler": "^5.0.1",
"@angular/compiler-cli": "^5.0.1",
"@angular/core": "^5.0.1",
"@angular/flex-layout": "^2.0.0-beta.10",
"@angular/forms": "^5.0.1",
"@angular/http": "^5.0.1",
"@angular/material": "5.0.0-rc.3",
"@angular/platform-browser": "^5.0.1",
"@angular/platform-browser-dynamic": "^5.0.1",
"@angular/platform-server": "^5.0.1",
"@angular/router": "^5.0.1",
},
"devDependencies": {
"@angular/cli": "1.5.0",
"@angular/compiler-cli": "^5.2.4",
"@angular/language-service": "^5.0.0",
}
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.