Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

my index.html file has the following :

  <script src="scripts/controllers/form/DashboardCtrl.js" />
  <script src="scripts/controllers/chart/morrisChartCtrl.js" />

my app.js file is as follows :

 return $routeProvider.when('/', {
        redirectTo: '/signin'
    }).when('/dashboard', {
        templateUrl: 'views/dashboard.html',secure: true
    })

My dashboard page is as follows :

    <div class="page page-dashboard" data-ng-controller="DashboardCtrl">

<div class="panel-body" data-ng-controller="morrisChartCtrl"> 
</div></div>

I can view the Dashboard page, but the morrisChartCtrl is not showing the chart.

My controller is defined as follows :

app.controller('morrisChartCtrl',  function($scope) {
$scope.mainData = [
  {
    month: '2013-01',
    xbox: 294000,
    will: 136000,
    playstation: 244000
  }];
});

So I am not able to figure out why myController is not being called

share|improve this question
    
can you bring it in fiddle ? –  Narek Mamikonyan Jul 22 '14 at 11:10
    
You have an empty DIV with a controller and data but no output at all? Makes sense that nothing is displayed. Maybe put something like {{mainData | json}} in the DIV. –  mainguy Jul 22 '14 at 11:45
    
Hi, the DIV is not empty, I made a mistake while putting it here. I dont see anything on the browser –  user3825003 Jul 23 '14 at 7:14

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.