typescript - Angular on doubleclick Div append to div -


i trying find way add inside div when double click it.

so have div:

<div>double click here</div> 

what need angular when doubleclick on div need code add "something" else of div.

for example...

before doubleclick have:

<div>double click here</div> 

and after doubleclick need have:

<div something>double click here</div> 

how can in angular 2 / 4 ?

i think looking this:

html

<div *ngif="show" (dblcick)="show=!show">you see first div</div> <div *ngif="!show" (dblclick)="show=!show">you see second div</div> 

or if trying add attribute on div:

html

<div [attr.somethingelse]="show ? true : null" (dblclick)="show=!show">double click me see change</div> 

plunker


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -