I am trying to do something that looks basic but I am not able to do it.
In have a simple directive
app.directive('mainContent', function() {
return {
restrict: 'E',
scope: {
content: "="
},
templateUrl: 'pages/home.html'
}
})
and a main page with a simple script
<main-content content="content"></main-content>
<script type="text/javascript">
$( document ).ready(function() {
if (window.location.href.indexOf("?Admin") > -1) {
$('.editable').attr('contenteditable','true');
}
});
</script>
The directive load the following content pages/home.html
<div class="jumbotron text-center editable">Lorem ipsum</div>
I suppose my script is unable to add contenteditable="true" attribute because the directive is creating a childscope.
How can I do this without ading my script in the pages/home.html ?
Regards