angular.js directive templateUrl fails to bind scope
问题 I'm creating a directive that will display and show content by listening to the $routeChangeError event on $rootScope. I got it all to work by inlining the template like this: app.directive("alert", function ($rootScope) { 'use strict'; return { restrict: "E", replace: true, template: '<div class="alert alert-warning alert-dismissable" ng-show="isError">' + '<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>' + '{{ message }}' + '</div>', //templateUrl: