Hi all,
I'm new to angularjs and I can't see why my code is blocked.
I have an html page like this:
<body ng-app="table"> <view-products></view-products> </body>
I want a directive named viewProducts to be inserted there
my app.js:
var route = '/learn/angularjs/';
var app = angular.module("table",[]);
app.directive("viewProducts",function(){
return{
restrict:"E",
templateUrl:route+"includes/view.html",
controller:['$scope','$http',function($scope,$http){
$http.get(route+'includes/view.json').success(function(data){
$scope.view = data;
});
}],
controllerAs:"view"
};
});
view.html:
<div> {{view.name}} </div>
view.json
{name:"view"}
When I open the browser I have a white page,
don't understand why.
Thank you for your help
Benjamin
--
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 http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.