By using following code:
$(function(){
$("#includedContent").load("extraContent.html");
});
I am including an HTML file via jQuery into my index page (see above). I am trying to add simple AngularJS code from the W3Schools site into the extraContent.html, but it's not working. For example...
<div ng-app="myApp" ng-controller="personCtrl">
First Name: <input type="text" ng-model="firstName"><br>
Last Name: <input type="text" ng-model="lastName"><br>
<br>
Full Name: {{fullName()}}
</div>
<script>
var app = angular.module('myApp', []);
app.controller('personCtrl', function($scope) {
$scope.firstName = "John";
$scope.lastName = "Doe";
$scope.fullName = function() {
return $scope.firstName + " " + $scope.lastName;
};
});
Any ideas?