File tree 1 file changed +12
-3
lines changed
1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -335,9 +335,18 @@ UrlMatcher.prototype.format = function (values) {
335
335
* See {@link ui.router.util.$urlMatcherFactory#methods_type `$urlMatcherFactory#type()`} for more
336
336
* information on registering custom types.
337
337
*
338
- * @param {Object } config A configuration object hash that includes any method in `Type`'s public
339
- * interface, and/or `pattern`, which should contain a custom regular expression used to match
340
- * string parameters originating from a URL.
338
+ * @param {Object } config A configuration object which contains the custom type definition. The object's
339
+ * properties will override the default methods and/or pattern in `Type`'s public interface.
340
+ * @example
341
+ * <pre>
342
+ * {
343
+ * decode: function(val) { return parseInt(val, 10); },
344
+ * encode: function(val) { return val && val.toString(); },
345
+ * equals: function(a, b) { return this.is(a) && a === b; },
346
+ * is: function(val) { return angular.isNumber(val) isFinite(val) && val % 1 === 0; },
347
+ * pattern: /\d+/
348
+ * }
349
+ * </pre>
341
350
*
342
351
* @property {RegExp } pattern The regular expression pattern used to match values of this type when
343
352
* coming from a substring of a URL.
You can’t perform that action at this time.
0 commit comments