VOOZH about

URL: https://www.geeksforgeeks.org/angular-js/how-to-change-image-source-url-using-angularjs/

⇱ How to Change Image Source URL using AngularJS ? - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

How to Change Image Source URL using AngularJS ?

Last Updated : 25 Jul, 2024

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:


Comment
Article Tags:

Explore