Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

<a name="1.2.0"></a>
## [1.2.0](https://github.com/robust-team/angular-forms/compare/v1.1.0...v1.2.0) (2017-09-22)

### Features

* Addition of **isPristine** and **isDirty** methods.

<a name="1.1.0"></a>
## [1.1.0](https://github.com/robust-team/angular-forms/compare/v1.0.1...v1.1.0) (2017-09-21)

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,8 @@ Example output:
| Method | Function |
|-|-|
| **isValid()** | Returns the status of form. |
| **isPristine()** | Returns if the user has not yet changed some value in the form. |
| **isDirty()** | Returns if the user has changed some value in the form. |
| **getAnswersGroups()** | Returns only the answers grouped in yours respective Groups. |
| **getAnswers()** | Returns only the answers of simple Questions and of DataTables (that is considered a Question). |
| **getForm()** | Returns an object with two attributes: **valid** (return of **isValid** method) and **value** (return of **getAnswersGroups** method. |
Expand Down
20 changes: 16 additions & 4 deletions demo/demo.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@ import { AngularFormsComponent } from '../src';
<div class='container'>
<h1>AngularForms</h1>
<rb-angular-forms #angularForms [groups]="customForm" [readOnly]="false" lang="pt-BR"></rb-angular-forms>
<button class="btn btn-primary" (click)="angularForms.submit(); getForm()">getForm()</button>
<button class="btn btn-primary" (click)="angularForms.submit(); isValid()">isValid()</button>
<button class="btn btn-primary" (click)="angularForms.submit(); getAnswersGroups()">getAnswersGroups()</button>
<button class="btn btn-primary" (click)="angularForms.submit(); getAnswers()">getAnswers()</button>
<button class="btn btn-primary" (click)="angularForms.submit()">submit()</button>
<button class="btn btn-primary" (click)="isPristine()">isPristine()</button>
<button class="btn btn-primary" (click)="isDirty()">isDirty()</button>
<button class="btn btn-primary" (click)="isValid()">isValid()</button>
<button class="btn btn-primary" (click)="getForm()">getForm()</button>
<button class="btn btn-primary" (click)="isValid()">isValid()</button>
<button class="btn btn-primary" (click)="getAnswersGroups()">getAnswersGroups()</button>
<button class="btn btn-primary" (click)="getAnswers()">getAnswers()</button>
</div>
`,
providers: [DemoService]
Expand All @@ -33,6 +37,14 @@ export class DemoComponent implements OnInit {
console.log(this.angularForms.getForm());
}

public isPristine(): void {
console.log(this.angularForms.isPristine());
}

public isDirty(): void {
console.log(this.angularForms.isDirty());
}

public isValid(): void {
console.log(this.angularForms.isValid());
}
Expand Down
6 changes: 6 additions & 0 deletions docs/changelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,12 @@

<h1 id="change-log">Change Log</h1>
<p>All notable changes to this project will be documented in this file. See <a href="https://github.com/conventional-changelog/standard-version">standard-version</a> for commit guidelines.</p>
<p><a name="1.2.0"></a></p>
<h2 id="-1-2-0-https-github-com-robust-team-angular-forms-compare-v1-1-0-v1-2-0-2017-09-22-"><a href="https://github.com/robust-team/angular-forms/compare/v1.1.0...v1.2.0">1.2.0</a> (2017-09-22)</h2>
<h3 id="features">Features</h3>
<ul>
<li>Addition of <strong>isPristine</strong> and <strong>isDirty</strong> methods.</li>
</ul>
<p><a name="1.1.0"></a></p>
<h2 id="-1-1-0-https-github-com-robust-team-angular-forms-compare-v1-0-1-v1-1-0-2017-09-21-"><a href="https://github.com/robust-team/angular-forms/compare/v1.0.1...v1.1.0">1.1.0</a> (2017-09-21)</h2>
<h3 id="features">Features</h3>
Expand Down
35 changes: 32 additions & 3 deletions docs/classes/AngularForms.html
Original file line number Diff line number Diff line change
Expand Up @@ -698,13 +698,13 @@ <h3 id="methods">
<tr>
<td class="col-md-4">
<a name="fromJson"></a>
<b><span class="modifier">Public</span> fromJson</b>
<span class="name"><b><span class="modifier">Public</span> fromJson</b><a href="#fromJson"><span class="fa fa-link"></span></a></span>
</td>
</tr>
<tr>
<td class="col-md-4">
<span class="modifier-icon method fa fa-play "></span>
<code>fromJson(jsonGroups: [])</code>
<span class="modifier-icon fa fa-reset"></span>
<code>fromJson(jsonGroups: <a href="../classes/Group.html">Group[]</a>)</code>
</td>
</tr>

Expand All @@ -718,10 +718,39 @@ <h3 id="methods">
<tr>
<td class="col-md-4">

<div class="io-description">
<b>Parameters :</b>
<table class="params">
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td>Optional</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td>jsonGroups</td>
<td>
<code><a href="../classes/Group.html" target="_self" >Group[]</a></code>
</td>
<td>
</td>
<td></td>
</tr>
</tbody>
</table>
</div>
<div>
</div>
<div class="io-description">
<b>Returns : </b> <code>[]</code>

</div>
<div class="io-description">

</div>
</td>
</tr>
</tbody>
Expand Down
33 changes: 31 additions & 2 deletions docs/classes/AngularFormsTranslateLoader.html
Original file line number Diff line number Diff line change
Expand Up @@ -704,12 +704,12 @@ <h3 id="methods">
<tr>
<td class="col-md-4">
<a name="getTranslation"></a>
<b><span class="modifier">Public</span> getTranslation</b>
<span class="name"><b><span class="modifier">Public</span> getTranslation</b><a href="#getTranslation"><span class="fa fa-link"></span></a></span>
</td>
</tr>
<tr>
<td class="col-md-4">
<span class="modifier-icon method fa fa-play "></span>
<span class="modifier-icon fa fa-reset"></span>
<code>getTranslation(lang: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>)</code>
</td>
</tr>
Expand All @@ -724,10 +724,39 @@ <h3 id="methods">
<tr>
<td class="col-md-4">

<div class="io-description">
<b>Parameters :</b>
<table class="params">
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td>Optional</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td>lang</td>
<td>
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
</td>
<td>
</td>
<td></td>
</tr>
</tbody>
</table>
</div>
<div>
</div>
<div class="io-description">
<b>Returns : </b> <code>Observable&lt;any&gt;</code>

</div>
<div class="io-description">

</div>
</td>
</tr>
</tbody>
Expand Down
Loading