Currently, I am in the process of learning Angularjs and have two separate template pages - one for login (login.html) and another for the main content (index.html).
To incorporate a chart into my index.html page, I am utilizing a directive from here.
The issue I am facing is that I do not want to include
<script src="js/highcharts-ng.js"></script>
in my login.html page as it is not necessary there. However, if this script is omitted, I encounter an error with the current setup.
I am seeking advice on how I can consolidate 'highcharts-ng' into just one controller instead of including it throughout my entire application.
app.js
var myezteam = angular.module('myezteam', ['highcharts-ng']); //<-- Do not want highcharts-ng here
dashboard.js
myezteam.controller('DashboardController', ['$scope', '$http', 'myezteamBase', function($scope, $http, myezteamBase) {
...
I attempted restructuring the code as follows, but encountered this error:
Uncaught SyntaxError: Unexpected token -
myezteam.controller('DashboardController', ['$scope', '$http', 'myezteamBase', 'highcharts-ng', function($scope, $http, myezteamBase, highcharts-ng) {
...