How can I click to load a html form into a target in angular without using jquery?
My working script so far but I am stuck on
<html>
<head>
<script src="components/angular/angular.js"></script>
<script>
var app = angular.module("myapp", [])
app.controller("FormController",function($scope,$http) {
$scope.load = function() {
return $http({
method: "get",
url: "form.php"
}).then(function(response) {
$scope.form = response.data;
// how can I target id="form"??
});
};
}
);
</script>
</head>
<body>
<div ng-app="myapp" ng-controller="FormController">
<button ng-click="load()">Load</button>
<div id="form"> place the form here </div>
</div>
</div>
</body>
</html>
form.php,
<form name="signup_form" novalidate ng-submit="signupForm()">
<input type="text" />
</form>
Is that a proper way of doing it to load a form instead of using $http
?