I have master page which has script for angularJs and a div which acts as a parent div to load the html page which is created using angular.
ParentPage.aspx
<script src="../../Scripts/angular.min.js" type="text/javascript"></script>
<!-- Controller For Angular Page -->
<script src="../../Scripts/Controller/PartialRegistrationController.js" type="text/javascript"></script>
<script type="text/javascript">
var app = angular.module("module", []);
function partialRegistrationForm() { // Function to Initiate load call
$('#divFullRegistration').load('../RegistrationPages/PartialRegistration.htm', function (data) {
console.log(data);
});
</script>
<div id="divPopupRegistration" class="RegistrationPopup hide" style="overflow: hidden;z-index: 999" ng-app="module">
<div id="divFullRegistration" class="Full hide">
</div>
</div>
PartialRegistration.htm
<head>
<title></title>
</head>
<body ng-cloak>
<div ng-controller="partialcontroller" id="parentDiv" ng-init="init()">
<div class="registrationBg" runat="server" id="PartialRegistration">
// Some HTML
</div>
</div>
</body>
I have some angular textbox and drop down which gets data from server. I can see empty dropdown in html page.
It works When i put <script type="text/javascript" src="../Scripts/angular.min.js"></script> in PartialRegistration.htm
But angular script is already loaded in ParentPage.aspx, so why this issue is coming ?
app.run(function(){ ............ });partial-registrationthat usesPartialRegistration.htmas its template. If you only want to load after something has happened in scope, you can useng-iffor that.divFullRegistrationelement.