Working on creating my first custom directive in AngularJS, but am having some problems when using the templateURL parameter; it doesn't actually request the page that I am attempting to call.
When I use the plain templateparameter, it works as expected though.
I think that maybe my path being used in the templateURL may be incorrect??
This is my HTML in my main page:
<div class="container" ng-controller="formFields">
<p>{{person.name}}</p>
<div ng-sparkline person="person"></div>
</div>
Here is my custom directive:
myApp.directive('ngSparkline', function() {
return {
replace: true,
restrict: 'EA',
scope: {
person: '='
},
//template: '<p class="lead">Hi, {{person.name}}!</p>'
templateURL: '/js/directives/formFields.html'
}
});
Here is my formFields.html file:
<p class="lead">Hey, {{person.name}}</p>
This is how my app directory is laid out:
My directives.js file is located in the js directory, while the formFields.html file is located in /js/directives/...
