Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New value null/empty check option [FEATURE REQUEST] #61

Open
lanceschi opened this issue Jun 7, 2013 · 5 comments
Open

New value null/empty check option [FEATURE REQUEST] #61

lanceschi opened this issue Jun 7, 2013 · 5 comments

Comments

@lanceschi
Copy link

Hi everyone,

it would be handy to have native support in this awesome module for null/not null value check. I made it by myself for example adding in the directive options hash:

ade-text='"... ,"null":false}"

and then in the text_directive.js file, saveEdit function I modify a section:

...
if(exited!=3) { //don't save value on esc
if(options.null == false){
if( input.val() ) {
value = input.val();
controller.$setViewValue(value);
}
} else {
value = input.val();
controller.$setViewValue(value);
}
}
...

Maybe if no change was made, broadcasting is to be considered redundant and not necessary in my opinion.

Ciao,
Luca

@offsky
Copy link
Owner

offsky commented Jun 7, 2013

Are you trying to prevent someone from clearing the text input. Basically forcing a value to exist other than empty string?

@lanceschi
Copy link
Author

Yes. In my case It's an option one can set in order to prevent a null/empty variable/model.

@offsky
Copy link
Owner

offsky commented Jun 11, 2013

I have scheduled this for version 1.3.

@lanceschi
Copy link
Author

Hooray! ;)

@offsky
Copy link
Owner

offsky commented May 7, 2015

I realize that I dropped the ball on this one. Sorry. I'll try to get it into the next major release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants