I am trying to get a custom directive that I created to work. The directive I created contains a table that references the controller. I did not include ProjectController in my code because this part works, but as soon as I put everything in the user directive, it stopped working. I believe that the custom directive does not fall. Any suggestions?
app.js
app.directive('projectInformation', function () { return { restrict: 'E', templateUrl: 'project-information.html', controller: function() { this.products = projects }, controllerAs: 'projectCtrl' }; });
Project-information.html
<table class="table table-striped"> <thead> <tr> <th>#</th> <th>Project </th> <th>Name </th> <th>Phone </th> <th>Company </th> <th>Date</th> </tr> </thead> <tbody> <tr ng-repeat="product in projectCtrl.products"> <td>{{ product.id }}</td> <td>{{ product.name }}</td> <td>{{ product.supervisor }}</td> <td>{{ product.phone }}</td> <td>{{ product.company }}</td> <td>{{ product.date }}</td> </tr> </tbody>
ReviewAndAdjust.cshtml
<div class="col-lg-6"> <project-information class="table-responsive"></project-information> </div> <div class="content" id="elementGrid"> <project-information class="active content table-responsive"></project-information> </div>
LayoutPage.cshtml
<html ng-app="dTIMSApp"> <head> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script> <script type="text/javascript" src="~/Scripts/app.js"></script> </head> <body> </body> </html>

I also tried using other alternatives to the custom elements directive. I tried a custom attribute directive and used the ng-include directive, but the div still won't be populated with a table from the html page. Also, the console log for the webpage says: "GET http: // localhost: 58893 / Dashboards / project-information.html 404 (not found) '
source share