In the code snippet below,
<!DOCTYPE html>
<html>
<head>
.....
</head>
<body ng-app="app">
<script type="text/ng-template" id="my-info-msg.html">
<strong>{{o.msg}}</strong>
</script>
<div ng-controller="emp as o">
<div my-info-msg>
</div>
</div>
</body>
</html>
var app = angular.module("app", []);
function MyController(){
this.msg= 'This is a message';
}
app.controller('emp', MyController);
function MsgDirective(){
return{
template1Url: "my-info-msg.html"
};
}
app.directive('myInfoMsg', MsgDirective);
The custom directive my-info-msg
is failing to insert the template
<strong>{{o.msg}}</strong>
into the <div my-info-msg> </div>
.
I am in need of assistance, please help!