Skip to content

Commit e5631b2

Browse files
committed
feat(demo): adding new example to the demo page
1 parent 602a160 commit e5631b2

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

src/app/app.component.html

+10
Original file line numberDiff line numberDiff line change
@@ -101,5 +101,15 @@ <h3>Inside of a table with width 100%</h3>
101101

102102
<hr/>
103103

104+
<div>
105+
<h3>Arbitrary content reseting
106+
<button (click)="resetArbitraryExample()">Reset</button></h3>
107+
<textarea autosize [(ngModel)]="resetableContent">
108+
reset
109+
</textarea>
110+
</div>
111+
112+
<hr/>
113+
104114

105115

src/app/app.component.ts

+12
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ const longText = `Mega Man X, known in Japan as Rockman X,[a] is an action-platf
55
1
66
2
77
3`;
8+
const resetExplanation = `In this text area we want to test if text after some manual changes can be restored to its original value and if textarea keeps autosizing...
9+
10+
so just change this text, add some lines...
11+
and in the end hit the 'RESET' button above.
12+
13+
Text area should come back to its original form :)
14+
`;
815

916
@Component({
1017
selector: 'app-root',
@@ -13,6 +20,7 @@ const longText = `Mega Man X, known in Japan as Rockman X,[a] is an action-platf
1320
})
1421
export class AppComponent {
1522
public longText = longText;
23+
public resetableContent = resetExplanation;
1624
public minRows = 3;
1725
public maxRows = 4;
1826
public onlyGrow = true;
@@ -38,4 +46,8 @@ export class AppComponent {
3846
reactiveText: current + "\n next"
3947
});
4048
}
49+
50+
resetArbitraryExample() {
51+
this.resetableContent = resetExplanation;
52+
}
4153
}

0 commit comments

Comments
 (0)