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
36 lines (28 loc) · 850 Bytes
/
container.js
File metadata and controls
36 lines (28 loc) · 850 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
27
28
29
30
31
32
33
34
35
36
/**
* MUI Angular Container Component
* @module angular/container
*/
import angular from 'angular';
const moduleName = 'mui.container';
angular.module(moduleName, [])
.directive('muiContainer', function() {
return {
restrict: 'AE',
template: '<div class="mui-container"></div>',
transclude: true,
scope : true,
replace: true,
link: function(scope, element, attrs, controller, transcludeFn) {
// use transcludeFn to pass ng-controller on parent element
transcludeFn(scope, function(clone) {
element.append(clone);
});
// handle fluid containers
if (!angular.isUndefined(attrs.fluid)){
element.removeClass('mui-container').addClass('mui-container-fluid');
}
}
};
});
/** Define module API */
export default moduleName;