javascript - What should be the correct path of templateUrl in angularJs directive? -
i want give path of templateurl seprate .jade file. showing 500 err , error: [$compile:tpload] .
below code in directive
app.directive('personrecord',['$http',function(http){ return{ restrict : 'ae', templateurl : '../../views/template.jade', link : function(scope,ele,attr){ } } }]);
and folder structure below.
bin node_modules public |-- js |-- main.js routes views |-- template.jade |-- index.jade app.js package.json
please me out in ! missing here !
my suggestion put views folder inside public folder:-
bin node_modules public |-- js | |-- main.js |--views |-- template.jade |-- index.jade routes app.js package.json
and use
app.directive('personrecord', function(http){ return { restrict : 'ae', templateurl : 'views/template.jade', link : function(scope, ele, attr){ } }; });
hope helps :)
Comments
Post a Comment