Edit This Code:
<!DOCTYPE html>
<html>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<body ng-app="">

<div ng-init="myVar = 'http://www.w3schools.com'">
<h1>Tutorials</h1>
<p>Go to <a ng-href="{{myVar}}">{{myVar}}</a> to learn!</p>
</div>

<p>This example could use the original href attribute, but in AngularJS, the ng-href attribute is safer.</p>

</body>
</html>


Result:
Try it Yourself - © w3schools.com
Privacy Policy