0

Is it possible to bind ng-model for input type image, something like this:

<input ng-model="imageName" type="image" ng-src="{{imageSrc}}">

I didn't find info in documentation, so I have tried, but without success.

Yennefer
  • 5,704
  • 7
  • 31
  • 44
Damjan Pavlica
  • 31,277
  • 10
  • 71
  • 76
  • This has already been asked before. See the answer here : http://stackoverflow.com/questions/17063000/ng-model-for-input-type-file – Shubham Patlani Nov 17 '15 at 08:10

1 Answers1

0

Yes, We can create.

I have created a fiddle for Demo, Hope it will resolve your problem

HTML Markup:

<div ng-app>
   <div ng-controller="test">
      <input ng-model="imageName" type="image" ng-src="{{imageUrl}}" />
   </div>
</div>

JavaScript Code:

function test($scope){
  $scope.imageName = 'logo';
  $scope.imageUrl='https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png';
}
Raveendra007
  • 1,060
  • 1
  • 8
  • 13