Skip to content

Commit dcb9e91

Browse files
Moser, AlexMoser, Alex
Moser, Alex
authored and
Moser, Alex
committed
First commit
0 parents  commit dcb9e91

File tree

4 files changed

+101
-0
lines changed

4 files changed

+101
-0
lines changed

LISCENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2015 nosedive25
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# ngBootMaterial
2+
3+
For using [bootstrap-material-design](https://github.com/FezVrasta/bootstrap-material-design) with angular.
4+
5+
A slight modification to [ng-bootstrap-material](https://github.com/nosedive25/ng-bootstrap-material) that will let you use this more dynamically with angular.
6+
7+
Ran into an issue where the bootstrap-material items were being brough on dynamically through angular, this will re init them every time they are loaded on the page.
8+
9+
works for:
10+
11+
`material-input`
12+
`material-ripple`
13+
`material-checkbox`
14+
`material-radio`
15+
16+
17+
To use add the directive onto the material bootstrap item like so :
18+
19+
`<input type="checkbox" material-checkbox-fix>`
20+
21+
22+

bower.json

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "ng-boot-material",
3+
"version": "0.1",
4+
"homepage": "https://github.com/ajmajma/ngBootMaterial",
5+
"authors": [
6+
"ajmajma"
7+
],
8+
"description": "Fix for using bootstrap-material with angular dynmically",
9+
"main": "ngBootMaterial.js",
10+
"dependencies": {
11+
"bootstrap-material-design" : "latest",
12+
"angularjs" : "latest"
13+
},
14+
"keywords": [
15+
"material",
16+
"design",
17+
"bootstrap",
18+
"angular"
19+
],
20+
"license": "MIT",
21+
"ignore": [
22+
"**/.*",
23+
"node_modules",
24+
"bower_components"
25+
]
26+
}

ngBootMaterial.js

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
'use strict';
2+
3+
angular.module('ngBootMaterial', [])
4+
.directive('materialInputFix', function() {
5+
return {
6+
restrict: 'A',
7+
link: function(elem, attr, tr) {
8+
$.material.input(elem[0]);
9+
}
10+
};
11+
}).directive('materialRippleFix', function() {
12+
return {
13+
restrict: 'A',
14+
link: function(elem, attr, tr) {
15+
$.material.ripples(elem[0]));
16+
}
17+
};
18+
}).directive('materialCheckboxFix', function() {
19+
return {
20+
restrict: 'A',
21+
link: function(elem, attr, tr) {
22+
$.material.checkbox(elem[0]));
23+
}
24+
};
25+
}).directive('materialRadioFix', function() {
26+
return {
27+
restrict: 'A',
28+
link: function(elem, attr, tr) {
29+
$.material.radio(elem[0]));
30+
}
31+
};
32+
});

0 commit comments

Comments
 (0)