I have an Angular app consisting of an HTML page, a view being routed to that page, and a template for a directive that I want to add to the view being routed.
The index.html page displays the view using ngRoute fine. I am trying to use angular charts withing the view that is being routed, but I can't get the chart to show up. The code for the html page being routed is:
<!DOCTYPE html>
<html lang="en">
<head>
...
</head>
<body>
---Some Code----
<div create-chart></div>
</body>
</html>
The "create-chart" element refers to the directive which creates a chart in a separate html template.
The code for constructing the directive is:
var app = angular.module('penny', ['ngRoute', 'pennyControllers']);
app.config(['$routeProvider', ...
var chart = angular.module('chart', ['chart.js']);
app.directive('createChart', function () {
return {
restrict: 'E',
templateUrl: '../chart/chart.html'
};
});
Does anyone know why the chart won't display?