Describe the issue. What is the issue and what did you expect?
I'm unable to display charts on my home.html page using ngRoute. Attaching code snippets for
the five files as well below.
Please make sure to review and check all of these items:
[ ] Use latest version of the library
[ ] Make sure you've included all the dependencies e.g Chart.js, angular, etc.
[ ] Include a repro case, see below.
Step to reproduce
Index.html
<!DOCTYPE html>
module.js
var chartApp= angular.module('chartApp', ['chart.js']);
var myApp = angular.module('passportApp',['ngRoute','chartApp']);
Overview
Describe the issue. What is the issue and what did you expect? I'm unable to display charts on my home.html page using ngRoute. Attaching code snippets for the five files as well below.
Please make sure to review and check all of these items:
Step to reproduce
Index.html
<!DOCTYPE html>
module.js
var chartApp= angular.module('chartApp', ['chart.js']); var myApp = angular.module('passportApp',['ngRoute','chartApp']);
routerconfig.js myApp.config(function($routeProvider, $locationProvider) { $locationProvider.html5Mode(true); $routeProvider .when("/home", { templateUrl: "views/home.html", controller: "HomeController as home", authRequired: true }) .otherwise({ templateUrl: "views/login.html", controller: "LoginController as login" });
home.html
<canvas id="base" class="chart-bar" chart-data="home.data" chart-labels="home.labels" chart-colors="home.colors" chart-dataset-override="home.datasetOverride" >
home.controller.js
myApp.controller('HomeController', function($http, $location){
ctrl.displayChart=function(){ console.log('inside displayChart function'); ctrl.colors = ['#45b7cd', '#ff6384', '#ff8e72'];
}
});
Ensure you add a link to a plunker, jsbin, or equivalent. Issues without repro steps may be closed immediately.
Here is a jsbin template for 0.x version and one for 1.x for convenience.