JsBin でデモを行いたい作業コードがありますが、AngularJS ディレクティブtemplateUrlを機能させることができません (テンプレート値で機能します)。 http://jsbin.com/guvok/はhttp://jsbin.com/razit/を参照しようとしていますが失敗します。
完全性と後世のために、コードは次のとおりです。
hello.html
<!DOCTYPE html>
<html ng-app="hello">
<head>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.19/angular.min.js"></script>
</head>
<body>
<div hello></div>
</body>
</html>
こんにちは.css
.hello__content {
background: #fff;
}
hello.js
var meter = angular.module('hello', [])
.directive( 'hello', function() {
return {
restrict: 'A',
replace: true,
//template: '<p class="hello__content">hello</p>',
templateUrl: 'http://jsbin.com/razit/',
};
});
template.html
<p>hello, world</p>