Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
feat(NgMessages): introduce the NgMessages module and directives
Browse files Browse the repository at this point in the history
The ngMessages module provides directives designed to better support
handling and reusing error messages within forms without the need to
rely on complex structural directives.

Please note that the API for ngMessages is experimental and may possibly change with
future releases.
  • Loading branch information
matsko committed May 2, 2014
1 parent c0b4e2d commit 0f4016c
Show file tree
Hide file tree
Showing 5 changed files with 879 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ module.exports = function(grunt) {
ngLocale: {
files: { src: 'src/ngLocale/**/*.js' },
},
ngMessages: {
files: { src: 'src/ngMessages/**/*.js' },
},
ngMock: {
files: { src: 'src/ngMock/**/*.js' },
},
Expand Down Expand Up @@ -190,6 +193,10 @@ module.exports = function(grunt) {
dest: 'build/angular-resource.js',
src: util.wrap(files['angularModules']['ngResource'], 'module')
},
messages: {
dest: 'build/angular-messages.js',
src: util.wrap(files['angularModules']['ngMessages'], 'module')
},
animate: {
dest: 'build/angular-animate.js',
src: util.wrap(files['angularModules']['ngAnimate'], 'module')
Expand Down
5 changes: 5 additions & 0 deletions angularFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ angularFiles = {
'ngCookies': [
'src/ngCookies/cookies.js'
],
'ngMessages': [
'src/ngMessages/messages.js'
],
'ngResource': [
'src/ngResource/resource.js'
],
Expand Down Expand Up @@ -128,6 +131,7 @@ angularFiles = {
'test/auto/*.js',
'test/ng/**/*.js',
'test/ngAnimate/*.js',
'test/ngMessages/*.js',
'test/ngCookies/*.js',
'test/ngResource/*.js',
'test/ngRoute/**/*.js',
Expand Down Expand Up @@ -189,6 +193,7 @@ angularFiles = {

angularFiles['angularSrcModules'] = [].concat(
angularFiles['angularModules']['ngAnimate'],
angularFiles['angularModules']['ngMessages'],
angularFiles['angularModules']['ngCookies'],
angularFiles['angularModules']['ngResource'],
angularFiles['angularModules']['ngRoute'],
Expand Down
2 changes: 2 additions & 0 deletions src/ngAnimate/animate.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
* | {@link ng.directive:ngClass#usage_animations ngClass} | add and remove (the CSS class(es) present) |
* | {@link ng.directive:ngShow#usage_animations ngShow} & {@link ng.directive:ngHide#usage_animations ngHide} | add and remove (the ng-hide class value) |
* | {@link ng.directive:form#usage_animations form} & {@link ng.directive:ngModel#usage_animations ngModel} | add and remove (dirty, pristine, valid, invalid & all other validations) |
* | {@link ngMessages.directive:ngMessage#usage_animations ngMessages} | add and remove (ng-active & ng-inactive) |
* | {@link ngMessages.directive:ngMessage#usage_animations ngMessage} | enter and leave |
*
* You can find out more information about animations upon visiting each directive page.
*
Expand Down
Loading

1 comment on commit 0f4016c

@plentz
Copy link
Contributor

@plentz plentz commented on 0f4016c May 29, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matsko is it possible to use a ngMessages "master" and show all messages for form and it's nested forms errors?

this is basically what I'm trying to achieve: http://stackoverflow.com/questions/23922015/how-to-access-error-from-nested-forms

Please sign in to comment.