Angularjs Examples

AJS Examples


AngularJS ng-Src Directive

The AngularJS ng-src directive is used to set path like src.

Syntax

<img ng-src="http://www.tectstikers.com/{{id}}"/>

AngularJS ng-Src Directive Example

<html>
<head>
<title>My first AngularJS ng-src Directive code</title>
<Script SRC="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.js">
</Script>
<Script>
function appController($scope) {
$scope.path = "http://www.techstrikers.com/logo/techstrikers_logo.png";
}
</Script>
</head>
<body>
<div ng-app ng-controller="appController">

This is site url : <img src="{{ path }}">

</div>

</body>
</html>
See Live Example