![]() |
VOOZH | about |
Here the task is to change the source URL of the image with the help of AngularJS.
Approach: The approach is to change the URL of the image when the user click on button. When a user clicks on a button then a method is called along with the new URL, that method replaces the new URL with the old one in controller.
Example 1:
Output:
Example 2: In this example, the URL changing can be seen in output.
Output: