Greetings! I am a newcomer trying to grasp the concepts of angularjs/typescript.
I have compiled an array of fruits, displayed in an unordered list. My goal is to arrange them in descending order and implement a reverse search function to display the items in alphabetic order upon clicking a button. However, I am unsure of how the function should be implemented... Any assistance would be greatly appreciated!
Here is the snippet of HTML code:
export class AppComponent {
fruits: string[] = ["Apple", "Banana", "Orange", "Peach", "Pear"];
}
<ul>
<li *ngFor="let fruits of fruits">{{fruits}}
</li>
</ul>
<button ng-click="send()">Sort </button>