问题
I'm new to Angular and want to start with something simple to learn.
I'm currently developing a form and have divs which I need to toggle upon user selection. Do I need to create Angular 6 component to create such a toggle function?
How can I do the toggle - whether with component or without (if possible)?
Thanks
回答1:
You could try something like:
const isOpened = true;
<div *ngIf="isOpened">
<form> </form>
<div>
<div *ngIf="!isOpened">
<form> </form>
<div>
来源:https://stackoverflow.com/questions/50946102/toggle-div-with-angular-6