Skip to content

Commit 006c8aa

Browse files
committed
add docs
1 parent 535114c commit 006c8aa

File tree

7 files changed

+23
-8
lines changed

7 files changed

+23
-8
lines changed

README.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# AngularFormus
2-
[![Bower version](https://img.shields.io/badge/bower-v0.0.2-brightgreen.svg)](https://github.com/NullRefExcep/AngularFormus/releases)
2+
[![Bower version](https://img.shields.io/badge/bower-v0.0.6-brightgreen.svg)](https://github.com/NullRefExcep/AngularFormus/releases)
33
[![MIT License](https://img.shields.io/badge/license-MIT-green.svg)](https://tldrlegal.com/license/mit-license)
44

55
Customizable and extensible forms generator for AngularJS. License under MIT License.
@@ -343,4 +343,12 @@ app.config(['FormusLinkerProvider', function (FormusLinkerProvider) {
343343
});
344344
}]);
345345
```
346+
#### Wrapper
346347
348+
Every field in form is wrapped in special directive, it name `formusWrapper`.
349+
Is possible to override it template by using `FormusTemplates` service:
350+
```js
351+
app.config(['FormusTemplatesProvider', function (FormusTemplatesProvider) {
352+
FormusTemplatesProvider.setTemplateUrl('wrapper', 'views/formus/inputs/my-custm-wrapper.html');
353+
}]);
354+
```

app/js/formus.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ formus.directive('formusForm', function($q, FormusLinker, FormusTemplates, Formu
344344
});
345345

346346
/**
347-
* Service with specific functions
347+
* Service with useful functions
348348
*/
349349
formus.provider('FormusHelper', function() {
350350
var setConfigByName = function setConfigByName(self, path, prop, value) {
@@ -541,6 +541,7 @@ formus.provider('FormusHelper', function() {
541541

542542
/**
543543
* Provide container for directives linkers
544+
* This service allows to create custom link functions for different field types
544545
*/
545546
formus.provider('FormusLinker', function() {
546547
var loadTemplateLinker = function($scope, $element, $compile, FormusTemplates, $log) {
@@ -740,6 +741,8 @@ formus.provider('FormusTemplates', function() {
740741

741742
/**
742743
* Service for validation
744+
*
745+
* This service allows to contain validator functions and perform validation of field values
743746
*/
744747
formus.provider('FormusValidator', function($logProvider) {
745748
var validators = {
@@ -827,8 +830,7 @@ formus.directive('formusWrapper', function(FormusTemplates, FormusLinker, $timeo
827830
templateUrl: FormusTemplates.getUrl('wrapper'),
828831
link: {
829832
post: function($scope, $element, $attr) {
830-
$scope.input = $scope.$$childHead.$$childHead;
831-
833+
$scope.input = $scope.$$childHead.$$childHead;
832834
}
833835
}
834836
};

dist/formus.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@
332332
}
333333
]);
334334
/**
335-
* Service with specific functions
335+
* Service with useful functions
336336
*/
337337
formus.provider('FormusHelper', function () {
338338
var setConfigByName = function setConfigByName(self, path, prop, value) {
@@ -521,6 +521,7 @@
521521
});
522522
/**
523523
* Provide container for directives linkers
524+
* This service allows to create custom link functions for different field types
524525
*/
525526
formus.provider('FormusLinker', function () {
526527
var loadTemplateLinker = function ($scope, $element, $compile, FormusTemplates, $log) {
@@ -709,6 +710,8 @@
709710
});
710711
/**
711712
* Service for validation
713+
*
714+
* This service allows to contain validator functions and perform validation of field values
712715
*/
713716
formus.provider('FormusValidator', [
714717
'$logProvider',

src/helper.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Service with specific functions
2+
* Service with useful functions
33
*/
44
formus.provider('FormusHelper', function() {
55
var setConfigByName = function setConfigByName(self, path, prop, value) {

src/linker.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/**
22
* Provide container for directives linkers
3+
* This service allows to create custom link functions for different field types
34
*/
45
formus.provider('FormusLinker', function() {
56
var loadTemplateLinker = function($scope, $element, $compile, FormusTemplates, $log) {

src/validator.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
/**
22
* Service for validation
3+
*
4+
* This service allows to contain validator functions and perform validation of field values
35
*/
46
formus.provider('FormusValidator', function($logProvider) {
57
var validators = {

src/wrapper.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ formus.directive('formusWrapper', function(FormusTemplates, FormusLinker, $timeo
55
templateUrl: FormusTemplates.getUrl('wrapper'),
66
link: {
77
post: function($scope, $element, $attr) {
8-
$scope.input = $scope.$$childHead.$$childHead;
9-
8+
$scope.input = $scope.$$childHead.$$childHead;
109
}
1110
}
1211
};

0 commit comments

Comments
 (0)