Skip to content
This repository was archived by the owner on Jan 22, 2018. It is now read-only.

Commit 22cc671

Browse files
author
Kamil Kisiela
committed
Initial commit
0 parents  commit 22cc671

File tree

12 files changed

+281
-0
lines changed

12 files changed

+281
-0
lines changed

.gitignore

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Created by .ignore support plugin (hsz.mobi)
2+
### Example user template template
3+
### Example user template
4+
5+
# IntelliJ project files
6+
.idea
7+
*.iml
8+
out
9+
gen### Node template
10+
# Logs
11+
logs
12+
*.log
13+
npm-debug.log*
14+
15+
# Runtime data
16+
pids
17+
*.pid
18+
*.seed
19+
20+
# Directory for instrumented libs generated by jscoverage/JSCover
21+
lib-cov
22+
23+
# Coverage directory used by tools like istanbul
24+
coverage
25+
26+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
27+
.grunt
28+
29+
# node-waf configuration
30+
.lock-wscript
31+
32+
# Compiled binary addons (http://nodejs.org/api/addons.html)
33+
build/Release
34+
35+
# Dependency directory
36+
# https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git
37+
node_modules
38+
### JetBrains template
39+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio
40+
41+
*.iml
42+
43+
## Directory-based project format:
44+
.idea/
45+
# if you remove the above rule, at least ignore the following:
46+
47+
# User-specific stuff:
48+
# .idea/workspace.xml
49+
# .idea/tasks.xml
50+
# .idea/dictionaries
51+
52+
# Sensitive or high-churn files:
53+
# .idea/dataSources.ids
54+
# .idea/dataSources.xml
55+
# .idea/sqlDataSources.xml
56+
# .idea/dynamic.xml
57+
# .idea/uiDesigner.xml
58+
59+
# Gradle:
60+
# .idea/gradle.xml
61+
# .idea/libraries
62+
63+
# Mongo Explorer plugin:
64+
# .idea/mongoSettings.xml
65+
66+
## File-based project format:
67+
*.ipr
68+
*.iws
69+
70+
## Plugin-specific files:
71+
72+
# IntelliJ
73+
/out/
74+
75+
# mpeltonen/sbt-idea plugin
76+
.idea_modules/
77+
78+
# JIRA plugin
79+
atlassian-ide-plugin.xml
80+
81+
# Crashlytics plugin (for Android Studio and IntelliJ)
82+
com_crashlytics_export_strings.xml
83+
crashlytics.properties
84+
crashlytics-build.properties
85+

README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
FormlyMaterial
2+
==========
3+
4+
Material Design Templates for [Angular-Formly](http://angular-formly.com). Modern & flexible forms configured easily in a JSON object.
5+
6+
**Angular Formly is not part of Atmosphere. You have to add it manually**
7+
8+
## Install
9+
10+
```
11+
meteor add mys:angular-formly-templates-material
12+
```
13+
14+
15+
## Getting Started
16+
17+
1. Add package using `meteor add`
18+
2. Add manually angular-formly library to your project
19+
3. Add the following dependencies to your Angular module:
20+
21+
```javascript
22+
angular.module('myAppName', [
23+
'ngMessages',
24+
'ngMaterial',
25+
'formly',
26+
'formlyMaterial'
27+
])
28+
```
29+
30+
# Components
31+
32+
## Fields
33+
34+
- input
35+
- _rest fields in near future_
36+
37+
## Wrappers
38+
39+
- mdInputContainer
40+
- label
41+
- ngMessages
42+
43+
##Roadmap
44+
- all basic fields
45+
- basic wrappers
46+
- e2e tests
47+
- Requests (?). Post an issue.

lib/client/main.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
var {SetModule} = angular2now;
2+
3+
SetModule('formlyMaterial', [
4+
'ngMaterial',
5+
'formly'
6+
])
7+
.provider('formlyMaterial', formlyMaterial);
8+
9+
function formlyMaterial() {
10+
var self = this;
11+
12+
this.templateUrl = function (templateUrl) {
13+
return 'mys_angular-formly-templates-material_' + templateUrl.replace(/^\//, "");
14+
};
15+
16+
this.$get = function () {
17+
return {
18+
templateUrl: self.templateUrl
19+
}
20+
};
21+
}

lib/client/types/input/input.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
var {SetModule} = angular2now;
2+
3+
SetModule('formlyMaterial')
4+
.config((formlyConfigProvider, formlyMaterialProvider) => {
5+
6+
formlyConfigProvider.setType({
7+
name: 'input',
8+
templateUrl: formlyMaterialProvider.templateUrl('lib/client/types/input/input.ng.html'),
9+
wrapper: ['mdLabel', 'mdMessages', 'mdInputContainer'],
10+
defaultOptions: {
11+
ngModelAttrs: {
12+
mdMaxlength: {
13+
bound: 'md-maxlength'
14+
}
15+
}
16+
}
17+
});
18+
19+
});

lib/client/types/input/input.ng.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<input ng-model="model[options.key]">
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
var {SetModule} = angular2now;
2+
3+
SetModule('formlyMaterial')
4+
.config((formlyConfigProvider, formlyMaterialProvider) => {
5+
6+
formlyConfigProvider.setWrapper({
7+
name: 'mdInputContainer',
8+
templateUrl: formlyMaterialProvider.templateUrl('lib/client/wrappers/input-container/input-container.ng.html')
9+
});
10+
11+
});
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<md-input-container>
2+
<formly-transclude></formly-transclude>
3+
</md-input-container>

lib/client/wrappers/label/label.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
var {SetModule} = angular2now;
2+
3+
SetModule('formlyMaterial')
4+
.config((formlyConfigProvider, formlyMaterialProvider) => {
5+
6+
formlyConfigProvider.setWrapper({
7+
name: 'mdLabel',
8+
templateUrl: formlyMaterialProvider.templateUrl('lib/client/wrappers/label/label.ng.html')
9+
});
10+
11+
});
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<label for="{{id}}" class="control-label">
2+
{{to.label}}
3+
{{to.required ? '*' : ''}}
4+
</label>
5+
<formly-transclude></formly-transclude>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
var {SetModule} = angular2now;
2+
3+
SetModule('formlyMaterial')
4+
.config((formlyConfigProvider, formlyMaterialProvider) => {
5+
6+
formlyConfigProvider.setWrapper({
7+
name: 'mdMessages',
8+
templateUrl: formlyMaterialProvider.templateUrl('lib/client/wrappers/messages/messages.ng.html')
9+
});
10+
11+
});

0 commit comments

Comments
 (0)