myApp.js
angular.module("myApp" , [subApp1]); //line1
subapp1.js
import mycontroller from './mycontroller';
angular.module("subApp1",[])
.config(['$stateProvider','$urlRouteProvider',function($stateProvider,$urlRouteProvider){
$stateProvider.state('home', {
url:'/home',
templateUrl: './app/home.html',
controller : myController //line 2
});
}])
.controller('myController',['$scope','$http', myController]]); //line 3
Issue :
Following is my home.html. Grid is directive that is working fine if i source data from json using ajax.but not working if i get scope data (same json) from controller.
<grid data-type="scope" data="mydata"></dashgrid>
In controller am getting data using $http.get that is working fine.but still its not getting populated in grid.
Error: Uncaught (in promise) TypeError: Cannot read property 'columns' of undefined(…)
Questions: 1)Is http get asynchronous ? whether grid getting loaded before actually data is loaded by $http.get 1) In this case when the controller will get instantiated (line1 or line 2 or line3 )? 2) what is difference between line 2 and line 3 ? Is line 3 necessary ?