Example:
var login = new Control("someLogin");
c.setErrors({"notUnique": true});
expect(c.valid).toEqual(false);
expect(c.errors).toEqual({"notUnique": true});
c.updateValue("newLogin");
expect(c.valid).toEqual(true);
BREAKING CHANGE:
Before:
ControlGroup.errors and ControlArray.errors returned a reduced value of their children controls' errors.
After:
ControlGroup.errors and ControlArray.errors return the errors of the group and array.
And ControlGroup.controlsErrors and ControlArray.controlsErrors return the reduce value of their children controls' errors.
Closes#4917
BREAKING CHANGE
The ROUTE_DATA token has been removed and replaced with a type RouteData,
allowing a type injection like we do with RouteParams.
Before:
constructor(routeParams: RouteParams, @Inject(ROUTE_DATA) routeData) {
let id = routeParams.get('id');
let name = ROUTE_DATA.name;
}
After:
constructor(routeParams: RouteParams, routeData: RouteData) {
let id = routeParams.get('id');
let name = routeData.get('name');
}
Fixes#4392Closes#4428
This is just a maintenance upgrade to keep us close to the latest release.
No known bugs are being fixed by this upgrade.
I also removed the npm override in .travis.yaml since node 4 ships with a recent version of npm
and usually this version is preferred (it might contain custom patches).
Closes#4939
Before this change we would exit while there were cleanup micro tasks scheduled for executions,
this caused tmp files to be left over and consume a lot of space.
Fixes#4441
The node version was updated in DEVELOPER.md due to #4527,
but nvm still uses v0.12 if not specified otherwise.
Update .nvmrc file to v4.2, which is the last node version.
Closes#4894
If PUB_CACHE is not set the pub dependencies are downloaded to a default
folder during the build because `gulp build` also runs `pub get`.
Running the tests locally PUB_CACHE is set to a subdirectory of the SDK
when the `env_dart.sh` script is sourced.
Therefore `build/pubbuild.dart` fails as it can't find the dependencies.
Closes#4900
Allow ControlGroups and ControlArrays to contain errors from their level, and
errors from their children. [Design Doc](https://docs.google.com/document/d/1EnJ3-_iFpVKFz1ifN1LkXSGQ7h3A72OQGry2g8eo7IA/edit?pli=1#heading=h.j53rt81eegm4)
BREAKING CHANGE: errors format has changed from validators. Now errors from
a control or an array's children are prefixed with 'controls' while errors
from the object itself are left at the root level.
Example:
Given a Control group as follows:
var group = new ControlGroup({
login: new Control("", required),
password: new Control("", required),
passwordConfirm: new Control("", required)
});
Before:
group.errors
{
login: {required: true},
password: {required: true},
passwordConfirm: {required: true},
}
After:
group.errors
{
controls: {
login: {required: true},
password: {required: true},
passwordConfirm: {required: true},
}
}