AngularJS - Dynamically Loading template Url using ng-include is commenting or not displaying

Posted by Kasani007 under AngularJS on 3/21/2016 | Points: 10 | Views : 511 | Status : [Member] | Replies : 0
AngularJS - Dynamically Loading template Url using ng-include is commenting or not displaying(by inspecting) when application is running .
How can i rectify this commenting

I have code as below:

templateController.js
======================

var app = angular.module("myApp", []);

app.controller("MyCtrl", function ($scope) {
function onChange() {
// alert("Selected Value: " + $("#Category").val() + "\nSelected Text: " + $("#Category").data("kendoDropDownList").text());
$scope.templateUrl = $("#Category").val();
return $scope.templateUrl;
};
Categorydata = [

{ CategoryId: "'http://localhost/IncludeDynamicTemplateUrl/Receipts.html'", CategoryName: "Receipts" },
{ CategoryId: "'http://localhost/IncludeDynamicTemplateUrl/Payments.html'", CategoryName: "Payments" },
{ CategoryId: "'http://localhost/IncludeDynamicTemplateUrl/Loans.html'", CategoryName: "Loans" }


];
$("#Category").kendoDropDownList({
dataTextField: "CategoryName",
dataValueField: "CategoryId",
dataSource: Categorydata,
index: 0,
change: onChange
});
});


Default.html
=============

<!DOCTYPE html>
<html ng-app="myApp">
<head>
<title></title>
</head>
<body ng-controller="MyCtrl">
<div class="form-group">
<label for="receipts">Category Names :</label>
<div>
<select id="Category" />
</div>
</div>
<div>
<div ng-include="templateUrl"></div>
</div>
</body>
</html>




Responses

(No response found.)

Login to post response