I've seen this issue asked however, I'm a little stumped with mine. Solutions state to remove one of the controllers. So when I remove the ng-controller=sigSearchResults from the body tag, my results do not get populated in the ng-grid="gridOptions" . How do rectify this?
var sig = angular.module('sig', ['ngRoute']);
sig.config([ '$routeProvider', function($routeProvider) {
$routeProvider.when('/search/:sig', {
template : ' ',
controller : 'sigSearchResults'
}).when('/', {
template : ' ',
controller : 'sigSearchResults'
}).otherwise({
redirectTo : '/'
});
} ]);
sig.controller('sigSearchResults', function($scope,$log,$http,$q,$routeParams, $window) {
console.log($routeParams);
//code that populates ng-grid to gridOptions element.
});
<html ng-app="sig">
<body ng-controller="sigSearchResults">
<div class="contentContainer">
<div ng-view></div>
<!-- This is the template for the result -->
<script type="text/ng-template" id="sig-search-result-id" >
<div ng-show="loading" style='clear:both; text-align: center;'>Loading report...<img src="../media/images/Wait3.gif"></div>
<div ng-show="!loading" class="gridStyle" ng-grid="gridOptions"></div>
</script>
</div>