forked from muicss/mui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontainer.js
More file actions
26 lines (25 loc) · 782 Bytes
/
container.js
File metadata and controls
26 lines (25 loc) · 782 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
module.exports = angular.module('mui.container', [])
.directive('muiContainer', function() {
return {
restrict: 'AE',
template: '<div class="mui-container"></div>',
transclude: true,
scope : true,
replace: true,
link: function(scope, element, attr, controller, linker) {
/**
* <mui-container ng-controller=""></mui-container>
* ng-transclude's scope problem , if ng-transclude used , ng-controller will not work.
*/
linker(scope, function(clone) {
element.append(clone);
});
/**
* if fluid
*/
if(!angular.isUndefined(attr.fluid)){
element.removeClass('mui-container').addClass('mui-container-fluid');
}
}
};
});