mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(ionSideMenu): use manual transclude instead of ngTransclude
Fixes #666
This commit is contained in:
@@ -153,7 +153,7 @@ angular.module('ionic.ui.sideMenu', ['ionic.service.gesture', 'ionic.service.vie
|
||||
replace: true,
|
||||
transclude: true,
|
||||
scope: true,
|
||||
template: '<div class="menu menu-{{side}}" ng-transclude></div>',
|
||||
template: '<div class="menu menu-{{side}}"></div>',
|
||||
compile: function(element, attr, transclude) {
|
||||
angular.isUndefined(attr.isEnabled) && attr.$set('isEnabled', 'true');
|
||||
angular.isUndefined(attr.width) && attr.$set('width', '275');
|
||||
@@ -176,6 +176,10 @@ angular.module('ionic.ui.sideMenu', ['ionic.service.gesture', 'ionic.service.vie
|
||||
$scope.$watch($attr.isEnabled, function(val) {
|
||||
sideMenu.setIsEnabled(!!val);
|
||||
});
|
||||
|
||||
transclude($scope, function(clone) {
|
||||
$element.append(clone);
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
@@ -23,11 +23,12 @@
|
||||
<h1>Content</h1>
|
||||
</ion-content>
|
||||
</ion-pane>
|
||||
<ion-side-menu side="left" width="$root.menuWidth || 200">
|
||||
<ion-side-menu side="left" width="$root.menuWidth || 200" ng-controller="LeftCtrl">
|
||||
<header class="bar bar-header bar-assertive">
|
||||
<h1 class="title">Left</h1>
|
||||
</header>
|
||||
<ion-content has-header="true">
|
||||
<h3>value = {{value}}</h3>
|
||||
<ul class="list">
|
||||
<a href="#" class="item" ng-repeat="item in list">
|
||||
{{item.text}}
|
||||
@@ -62,6 +63,10 @@
|
||||
$scope.openLeft = function() {
|
||||
$ionicSideMenuDelegate.toggleLeft($scope);
|
||||
};
|
||||
})
|
||||
.controller('LeftCtrl', function($scope) {
|
||||
$scope.value = true;
|
||||
$scope.list = [{text:1},{text:2},{text:3}];
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user