Angularjs Examples

AJS Examples


AngularJS ng-Href Directive

The AngularJS ng-href directive is used to dynamically bind AngularJS variables to the href attribute.

Syntax

click here! 

AngularJS ng-Href Directive Example

<html>
<head>
<title>My first AngularJS ng-href Directive code</title>
<Script SRC="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.js">
</Script>
<Script>
//Defining Controller Using Standard Javascrip Object Constructor
function CustomerController($scope) {
  $scope.siteName = "http://www.techstrikers.com/AngularJS/AngularJS-ng-include-Live_Demo.php";
}
</Script>
</head>
<body>
<div ng-app="">
<div ng-controller="CustomerController"> 
<a href="{{ siteName }}"/>Click Here!</a>

</div>		
</div>
</body>
</html>
See Live Example