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

Commit 535c9db

Browse files
author
Kamil Kisiela
committed
demo: add documentation of Examples
1 parent fcac0c9 commit 535c9db

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

demo/client/data/examples.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,16 @@ class Examples {
1111
}
1212

1313
/**
14-
* Add example
14+
* Add new example
1515
*
16-
* @param {String} id
17-
* @param {String} section
18-
* @param {Object}
16+
* @param {String} id unique value for state `id` parameter
17+
* @param {Object} options formly configuration
18+
* @param {String} api it can be an absolute url or just `types/input.md` (see docs local variable)
1919
*/
20-
set(id, section, { fields, model, options }, api) {
20+
set(id, { fields, model, options }, api) {
2121
const docs = 'https://github.com/formly-js/angular-formly-templates-material/blob/master/docs/';
2222

2323
this.examples.set(id, {
24-
section,
2524
api: (typeof api === 'string' && !api.match('^http')) ? docs + api : api,
2625
formly: {
2726
fields,
@@ -31,6 +30,12 @@ class Examples {
3130
});
3231
}
3332

33+
/**
34+
* Get example
35+
*
36+
* @param {String} id example's identifier
37+
* @return {Object} example's data with API url and formly configuration
38+
*/
3439
get(id) {
3540
return this.examples.get(id);
3641
}

0 commit comments

Comments
 (0)