angular_forms 2.1.0

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 92

Pub Package

A port of the forms components that were in the core angular package.

2.1.0

New Features

  • PatternValidator now has a pattern input. This allows the pattern property to be set dynamically. Previously, this could only be specified statically at compile time.

2.0.0

New Features

  • Add AbstractControlGroup and AbstractNgForm to allow infrastructure to create their own form systems that can be backed by types such as a proto, or have different control group logic. Allow NgFormModel and NgControlGroup to work with abstract group.

  • reset method added to AbstractControl and AbstractControlDirective.

  • RequiredValidator now has a required input. This allows the required property to be toggled at runtime. Previously, this could only be set statically at compile time.

  • Control.invalid getter added.

  • Control.markAsPristine added. This will clear the dirty property.

  • Add ngDisabled input to all Control directives.

  • Add MemorizedForm directive. This is a form that will not remove controls if the control is taken out of the view, for example with a [NgIf].

  • Add disabled state to AbstractControl models. Note: This is not yet supported in the template-driven directives.

  • Add markAsUntouched method to AbstractControl.

  • Add a type annotation, T, to AbstractControl, which is tied to the type of value.

  • ControlGroup now extends AbstractControl<Map<String, dynamic>>.

  • ControlArray now extends AbstractControl<List>.

Breaking Changes

  • Use value from AbstractControl for valueChanges event instead of internal variable. Allows code to more easily subclass AbstractControl.

  • Remove deprecated NG_VALUE_ACCESSOR token. Use ngValueAccessor instead.

  • Abstract updateValue method added to AbstractControl. All subclasses of AbstractControl will need to implement this method.

  • NgControlName will no longer initialize with null if a value is specified by 'ngModel'.

  • The touched property of Controls is now propagated to parents / children.

  • NgControlGroup can no longer be injected directly. It can still be injected as a ControlContainer.

  • NgControlName and NgFormControl can no longer be injected directly. They can still be injected as a NgControl.

  • The following directives are no longer injectable:

    • CheckboxControlValueAccessor
    • DefaultValueAccnessor
    • MaxLengthValidator
    • MinLengthValidator
    • NgControlStatus
    • NgSelectOption
    • NumberValueAccessor
    • PatternValidator
    • RadioControlValueAccessor
    • RequiredValidator
  • Add ControlValueAccessor.onDisabledChanged() method. All implementations of ControlValueAccessor need to add this method.

  • Remove include and exclude methods from ControlGroup. These can be replaced with calls to markAsEnabled and markAsDisabled instead.

    Before: controlGroup.include('foo');

    After: controlGroup.controls['foo'].markAsEnabled();

  • CheckboxControlValueAccessor now implements ControlValueAccessor<bool> and RadioControlValueAccessor now implements ControlValueAccessor<RadioButtonState>. Previously, they were both ControlValueAccessor<dynamic>.

  • Remove optionals param from ControlGroup constructor. This has been replaced by disabled state for all Controls. See https://github.com/dart-lang/angular/issues/1037 for more details.

  • AbstractControl.find now only accepts a String. To supply a list, use AbstractControl.findPath instead. Also, for find or findPath, ControlArray index is now calling int.parse instead of expecting a raw number.

  • Properly typed the generic parameter on subclasses of AbstractControlDirective. Now, NgControl.control will return a Control, and ControlContainer.control will return a ControlGroup. There may be some unnecessary casts that can now be cleaned up.

  • FormBuilder instance methods group, control, and array have been removed. For FormBuilder.control, just call new Control(value, validator) directly. For FormBuilder.group and FormBuilder.array, use the static methods FormBuilder.controlGroup and FormBuilder.controlArray, respectively. FormBuilder is no longer Injectable.

  • Changed type of AbstractControl.statusChanges from Stream<dynamic> to Stream<String>. This now matches the type for AbstractControl.status, which as always been a String.

  • Allow expressions for maxlength/minlength validators. Breaking change does not support string values for maxlength/minlength anymore. minlength="12" now should be written [minlength]="12"

Bug fixes

  • Add a not selector to ngForm for memorizedForm since memorized_form is now in angular_forms. This fixes the DIRECTIVE_EXPORTED_BY_AMBIGIOUS error when using: <form #form="ngForm" memorizedForm>

  • Don't throw a null pointer exception in NgFormModel if a directives asks for a Control value before the form is initialized.

1.0.0

  • Support for angular 4.0.0.

0.1.0

  • Initial commit of angular_forms.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  angular_forms: ^2.1.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:angular_forms/angular_forms.dart';
  
Version Uploaded Documentation Archive
2.1.1 Dec 10, 2018 Go to the documentation of angular_forms 2.1.1 Download angular_forms 2.1.1 archive
2.1.0 Oct 10, 2018 Go to the documentation of angular_forms 2.1.0 Download angular_forms 2.1.0 archive
2.0.0 Aug 7, 2018 Go to the documentation of angular_forms 2.0.0 Download angular_forms 2.0.0 archive
1.0.0 Aug 30, 2017 Go to the documentation of angular_forms 1.0.0 Download angular_forms 1.0.0 archive
0.1.0 Aug 15, 2017 Go to the documentation of angular_forms 0.1.0 Download angular_forms 0.1.0 archive
2.0.0-beta+3 Aug 2, 2018 Go to the documentation of angular_forms 2.0.0-beta+3 Download angular_forms 2.0.0-beta+3 archive
2.0.0-beta+2 Jul 19, 2018 Go to the documentation of angular_forms 2.0.0-beta+2 Download angular_forms 2.0.0-beta+2 archive
2.0.0-beta+1 Jul 16, 2018 Go to the documentation of angular_forms 2.0.0-beta+1 Download angular_forms 2.0.0-beta+1 archive
2.0.0-beta Jun 29, 2018 Go to the documentation of angular_forms 2.0.0-beta Download angular_forms 2.0.0-beta archive
2.0.0-alpha+7 Jun 15, 2018 Go to the documentation of angular_forms 2.0.0-alpha+7 Download angular_forms 2.0.0-alpha+7 archive

All 25 versions...

Popularity:
Describes how popular the package is relative to other packages. [more]
96
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
70
Overall:
Weighted score of the above. [more]
92
Learn more about scoring.

We analyzed this package on Dec 5, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.7

Platforms

Detected platforms: web

Primary library: package:angular_forms/angular_forms.dart with components: html, js.

Maintenance suggestions

The description is too short. (-20 points)

Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use angular_forms.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0-dev.5.0 <3.0.0
angular ^5.1.0 5.1.0
meta ^1.1.4 1.1.6
Transitive dependencies
analyzer 0.33.6 0.34.0
angular_ast 0.5.7
angular_compiler 0.4.1
args 1.5.1
async 2.0.8
build 1.0.1
build_config 0.3.1+4
built_collection 4.1.0
built_value 6.1.6
charcode 1.1.2
code_builder 3.1.3
collection 1.14.11
convert 2.0.2
crypto 2.0.6
csslib 0.14.6
dart_style 1.2.0 1.2.1
fixnum 0.10.9
front_end 0.1.6+8 0.1.7
glob 1.1.7
html 0.13.3+3
intl 0.15.7
js 0.6.1+1
json_annotation 2.0.0
kernel 0.3.6+8 0.3.7
logging 0.11.3+2
matcher 0.12.4
package_config 1.0.5
path 1.6.2
plugin 0.2.0+3
pub_semver 1.4.2
pubspec_parse 0.1.2+3
quiver 2.0.1
source_gen 0.9.1+3
source_span 1.4.1
stack_trace 1.9.3
string_scanner 1.0.4
typed_data 1.1.6
utf 0.9.0+5
watcher 0.9.7+10
yaml 2.1.15
Dev dependencies
angular_test ^2.1.0
build_runner ^1.0.0
build_test ^0.10.2+5
build_web_compilers ^0.4.0+4
mockito ^3.0.0
test ^1.3.0