I'm trying to get a custom directive working in angular, partly following the official document.
In Chrome, i only see a blank page.
F12 shows this error:
XMLHttpRequest cannot load file:///home/jeff/workspace/angularjs-intro/playground/my-customer.html. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.
Here's what i got so far:
(function() {
var app = angular.module('docsRestrictDirective', []);
app.controller('Controller', function() {
});
app.directive('myCustomer', function() {
return {
restrict: 'E',
templateUrl: 'my-customer.html'
};
});
})();
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Example - example-example14-production</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.4/angular.min.js"></script>
<script src="script.js"></script>
</head>
<body ng-app="docsRestrictDirective">
<div ng-controller="Controller">
<my-customer></my-customer>
</div>
</body>
</html>
And my-customer.html
Name: {{customer.name}} Address: {{customer.address}}
Any help is appreciated.