This repository has been archived by the owner on Aug 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(input): add error states, md-maxlength
- Loading branch information
Showing
12 changed files
with
302 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<ng-app="inputErrorsApp" ng-controller="AppCtrl" layout="column"> | ||
|
||
<md-toolbar class="md-primary"> | ||
<h1 class="md-toolbar-tools"> | ||
Top Secret Project | ||
</h1> | ||
</md-toolbar> | ||
|
||
<md-content class="md-padding"> | ||
<form name="projectForm"> | ||
<md-input-container> | ||
<label>Description</label> | ||
<input md-maxlength="30" required name="description" ng-model="project.description"> | ||
<div ng-messages="projectForm.description.$error" ng-show="projectForm.description.$dirty"> | ||
<div ng-message="required">This is required.</div> | ||
<div ng-message="md-maxlength">The name has to be less than 30 characters long.</div> | ||
</div> | ||
</md-input-container> | ||
|
||
<md-input-container> | ||
<label>Client Name</label> | ||
<input required name="clientName" ng-model="project.clientName"> | ||
<div ng-messages="projectForm.clientName.$error" ng-show="projectForm.clientName.$dirty"> | ||
<div ng-message="required">This is required.</div> | ||
</div> | ||
</md-input-container> | ||
|
||
<md-input-container> | ||
<label>Hourly Rate (USD)</label> | ||
<input required type="number" step="any" name="rate" ng-model="project.rate" min="800" max="5000" required> | ||
<div ng-messages="projectForm.rate.$error"> | ||
<div ng-message="required">You've got to charge something! You can't just <b>give away</b> a Missile Defense System.</div> | ||
<div ng-message="min">You should charge at least $800 an hour. This job is a big deal... if you mess up, everyone dies!</div> | ||
<div ng-message="max">$5,000 an hour? That's a little ridiculous. I doubt event Bill Clinton could afford that.</div> | ||
</div> | ||
</md-input-container> | ||
</form> | ||
</md-content> | ||
|
||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
angular.module('inputErrorsApp', ['ngMaterial', 'ngMessages']) | ||
|
||
.controller('AppCtrl', function($scope) { | ||
$scope.project = { | ||
description: 'Nuclear Missile Defense System', | ||
clientName: 'Bill Clinton', | ||
rate: 100, | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.