I am trying to learn Angular js.
I want to embed another website as a part of my webpage; inside a "div".
I have the following code so far which does that for me.
However, the embedded website will have hyperlinks in it. When someone clicks on the hyperlinks,is there a way where the new contents are displayed inside the same div?
Is it possible?
<body ng-app="sampleApp">
<div ng-controller="CommonController">
<div>
<a href="#" ng-click="show()">ShowPage</a>
</div>
<div ng-bind-html-unsafe="expression"/>
</div>
<script
src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script>
<script>
var sampleApp = angular.module('sampleApp', []);
sampleApp
.controller(
'CommonController',
function($scope, $http) {
$scope.show = function() {
var responsePromise = $http
.get("http://localhost:8080/HelpDynamic/spring/welcome");
responsePromise.success(function(data, status,
headers, config) {
$scope.expression = data;
});
responsePromise.error(function(data, status,
headers, config) {
alert("AJAX failed!");
});
}
});
</script>
</body>