In my app I have a few views, which look the same way:
<ion-view title={{title}}>
<ion-nav-buttons side="right"></ion-nav-buttons>
<ion-content class="has-header">
<ion-refresher on-refresh="Refresh()" refreshing-icon="ion-ios7-reloading" pulling-icon="ion-ios7-arrow-thin-down">
</ion-refresher>
<ion-list>
</ion-list>
</ion-content>
Only ion-item element is always different. I've tried to create my own directive:
.directive('listView', ['$compile', function($compile) {
return {
restrict: 'E',
scope: {
title: '@',
buttons: '@',
onRefresh: '&'
},
replace: true,
transclude: true,
template: '<ion-view title={{title}}>'+
'<ion-nav-buttons side="right"></ion-nav-buttons>'+
'<ion-content class="has-header">' +
'<ion-refresher on-refresh="{{onRefresh()}}" refreshing-icon="ion-ios7-reloading" pulling-icon="ion-ios7-arrow-thin-down">' +
'</ion-refresher>' +
'<ion-list ng-transclude></ion-list>' +
'</ion-content>' +
'</ion-view>',
compile: function ($element, $attrs) {
return function link($scope, $element, $attrs, ctrls) {
};
}
};
}]);
How should look like my compile method to allow ionic directive like ion-list render before mine? Now it does’nt work.