I'm working on a project using Ionic, so I'm also using Angular 1. I don't know this framework well (I really prefer what Google have done with Angular 2 :-)).
Basically, I just want to create a new HTML element (a directive) and use it inside a view of my ionic app.
Here is how I declare my directive :
app.directive('smLocationSheet', function() {
return {
restrict: 'E',
transclude: true,
replace: true,
scope: {},
templateUrl: './locationSheet.html'
}
});
I have a very basic and static HTML template and some SCSS but that's not important. Inside my home.html
, I would like to use my directive like this :
<ion-view id="homeView" style="position: static !important;" view-title="Accueil" ng-init="init()">
<ion-content class="has-tabs">
<div id="map" data-tap-disabled="true"></div>
<sm-location-sheet></sm-location-sheet>
</ion-content>
</ion-view>
My js file describing the directive is well loaded but my directive doesn't 'render'. During debugging, I can see the html tag sm-location-sheet
but no template. Also, it should be replaced by my hmtl file.