Skip to content
This repository has been archived by the owner on Apr 30, 2018. It is now read-only.

Commit

Permalink
v8.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
formly-bot committed Mar 21, 2016
2 parents dc7abef + 9ab5f32 commit f8ca952
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 10 deletions.
11 changes: 8 additions & 3 deletions dist/formly.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* angular-formly JavaScript Library v8.0.5
* angular-formly JavaScript Library v8.1.0
*
* @license MIT (http://license.angular-formly.com)
*
Expand Down Expand Up @@ -153,7 +153,7 @@ return /******/ (function(modules) { // webpackBootstrap

ngModule.constant('formlyApiCheck', _providersFormlyApiCheck2['default']);
ngModule.constant('formlyErrorAndWarningsUrlPrefix', _otherDocsBaseUrl2['default']);
ngModule.constant('formlyVersion', ("8.0.5")); // <-- webpack variable
ngModule.constant('formlyVersion', ("8.1.0")); // <-- webpack variable

ngModule.provider('formlyUsability', _providersFormlyUsability2['default']);
ngModule.provider('formlyConfig', _providersFormlyConfig2['default']);
Expand Down Expand Up @@ -430,7 +430,7 @@ return /******/ (function(modules) { // webpackBootstrap
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = "https://github.com/formly-js/angular-formly/blob/" + ("8.0.5") + "/other/ERRORS_AND_WARNINGS.md#";
exports["default"] = "https://github.com/formly-js/angular-formly/blob/" + ("8.1.0") + "/other/ERRORS_AND_WARNINGS.md#";
module.exports = exports["default"];

/***/ },
Expand Down Expand Up @@ -546,6 +546,7 @@ return /******/ (function(modules) { // webpackBootstrap
_angularFix2['default'].extend(this, {
setType: setType,
getType: getType,
getTypes: getTypes,
getTypeHeritage: getTypeHeritage,
setWrapper: setWrapper,
getWrapper: getWrapper,
Expand Down Expand Up @@ -698,6 +699,10 @@ return /******/ (function(modules) { // webpackBootstrap
}
}

function getTypes() {
return typeMap;
}

function getTypeHeritage(parent) {
var heritage = [];
var type = parent;
Expand Down
6 changes: 3 additions & 3 deletions dist/formly.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/formly.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-formly",
"version": "8.0.5",
"version": "8.1.0",
"author": "Astrism <astrisms@gmail.com>",
"contributors": [
"Astrism <astrisms@gmail.com>",
Expand Down
5 changes: 5 additions & 0 deletions src/providers/formlyConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ function formlyConfig(formlyUsabilityProvider, formlyErrorAndWarningsUrlPrefix,
angular.extend(this, {
setType,
getType,
getTypes,
getTypeHeritage,
setWrapper,
getWrapper,
Expand Down Expand Up @@ -161,6 +162,10 @@ function formlyConfig(formlyUsabilityProvider, formlyErrorAndWarningsUrlPrefix,
}
}

function getTypes() {
return typeMap
}

function getTypeHeritage(parent) {
const heritage = []
let type = parent
Expand Down
13 changes: 11 additions & 2 deletions src/providers/formlyConfig.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ describe('formlyConfig', () => {
})


describe('setType/getType', () => {
let getterFn, setterFn
describe('setType/getType/getTypes', () => {
let getterFn, setterFn, getTypesFn
const name = 'input'
const template = '<input type="{{options.inputType}}" />'
const templateUrl = '/input.html'
Expand All @@ -195,6 +195,7 @@ describe('formlyConfig', () => {
beforeEach(inject(function(formlyConfig) {
getterFn = formlyConfig.getType
setterFn = formlyConfig.setType
getTypesFn = formlyConfig.getTypes
}))

describe('\(^O^)/ path', () => {
Expand All @@ -217,6 +218,14 @@ describe('formlyConfig', () => {
expect(getterFn('type2').templateUrl).to.equal(templateUrl)
})

it('should expose the mapping from type name to config', () => {
setterFn([
{name, template},
{name: 'type2', templateUrl},
])
expect(getTypesFn()).to.eql({[name]: getterFn(name), type2: getterFn('type2')})
})

it('should allow you to set a wrapper as a string', () => {
setterFn({name, template, wrapper})
expect(getterFn(name).wrapper).to.equal(wrapper)
Expand Down

0 comments on commit f8ca952

Please sign in to comment.