I have a drupal 8 backend restful api.

I'm using ui-route and  I have this parent state with child.

// CHANNELS PAGE ===============================
     









*   .state('channels', {            url: '/channels',            
templateUrl: 'channels.html',            controller: 'ChannelsCtrl'        
})        .state('channels.id', {            url: '/:id',            
templateUrl: 'channels.view.html',            controller: 
'ChannelsViewCtrl'        });*

now using this controller as below, the /channels is rendering the json 
data:

routerApp.controller('ChannelsCtrl', function ($scope,$http) {

   


* 
$http.get('http://pd.fourwebminds.com/channel').success(function(result){       
 
$scope.channels = result;    });    });*

however using the child controller, it is not rendering the details of the 
data. it is supposed to render the details of specific channel. 





*routerApp.controller('ChannelsViewCtrl', function 
($scope,$http,$stateParams) {         
$http.get('http://pd.fourwebminds.com/channel/' + $stateParams.id 
).success(function(result){        $scope.channel = result[0];    });*
    });


-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to