element-angular | Element for Angular | Frontend Framework library
kandi X-RAY | element-angular Summary
kandi X-RAY | element-angular Summary
Element for Angular
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of element-angular
element-angular Key Features
element-angular Examples and Code Snippets
Community Discussions
Trending Discussions on element-angular
QUESTION
I'm working in an Angular 11 Project.
I know there's the ngIf directive, which will only show the html element if set to true, but doesn't preserve spacing.
In the old AngularJS, there was ng-show and ng-hide. These properties would show/hide an element, but keep its spacing (effectively setting the css to visibility to hidden). But Angular no longer has those properties. Instead they recommend binding to the hidden property (https://angular.io/guide/ajs-quick-reference#ng-show).
However, this doesn't preserve the spacing (which is strange IMO).
Does Angular have a directive that hides the element while also preserving its spacing?
I can add a conditional class, where the class has a visibility of hidden, but I trying to confirm if Angular has a directive/property for this.
I wiped up a demo here: https://stackblitz.com/edit/hide-element-angular?file=src/app/autocomplete-auto-active-first-option-example.html
This shows the hidden and ngIf do not perserve spacing, while the conditional class will.
ANSWER
Answered 2021-Jun-08 at 20:07The issue is a CSS issue, namely the bootstrap/CSS framework [hidden]
definition has display: none
defined. The hide
class rightfully so has visibility: hidden;
.
If we add:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install element-angular
Usage:
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page