Pattern that doesn't allow whitespace at the begining. Please find the code below :
<input class="mdl-textfield__input inputMaterial" maxlength="100"
[(ngModel)]="getEmpName[i]" (keydown)="onKeyPress($event)" pattern="[a-zA-Z
]*" appFloatLabelDirective="" formControlName="employer_name">
You can take a look at the angular input-mask plugin for this kind of problem : https://github.com/assisrafael/angular-input-masks
It allows you to filter inputs, and create custom directives
^[^-\s][\w\s-]+$ - this pattern helped me.
Some of the ng-file-upload directives are clearly working here: I can see the image preview, and upload works well. I am now attempting to validate the image resolution. I see the following below when inspecting the element:
<input type="file" ngf-dimensions="$width == 114 && $height == 114" ng-select="onFileSelect($files)" accept="image/png" base-sixty-four-input="" ng-model="fileDesc.file" name="filename_png" id="filename_png" class="ng-untouched ng-valid ng-isolate-scope ng-valid-parse ng-dirty">
I can see that the ngf-dimensions attribute is getting populated correctly, and additionally, ng-dirty is getting set because I've attempted to upload a file at this point. But the file's dimensions are not 114x114. Shouldn't I be seeing ng-invalid instead of ng-valid?
I've also tried this longer phrasing, which I believe to be equivalent, with the same effect:
<input type="file" ngf-min-width="114" ngf-min-width="114" ngf-min-height="114" ngf-max-height="114" ... >
Is there something specific that needs to be done in order to enable the validation of form fields and the ability to check form.field.$error?
Updated to add ng-file-upload version: 11.2.0
Edited again to add the output of Test: {{form.field}}, should $validators be populated? Or perhaps I'm having some conflict by using the base64 upload directive as well here?
Test: {"$viewValue":{"filetype":"image/png","filename":"PNG successful.png","filesize":383443,"base64":"..."},"$validators":{},"$asyncValidators":{},"$parsers":[null,null,null,null],"$formatters":[],"$viewChangeListeners":[],"$untouched":true,"$touched":false,"$pristine":false,"$dirty":true,"$valid":true,"$invalid":false,"$error":{},"$name":"filename_png","$options":null}
I'm not familiar with the library, but it looks like its reference docs say:
ngf-dimensions="$width > 1000 || $height > 1000" or "validateDimension($file, $width, $height)"
// validate the image dimensions, validate error name: dimensions
If I look at the author's validation example below, he appears to be using the required attribute, which may be your only issue, but I would also check form.file.$error.dimensions to see if the error is being caught at all:
<input type="file" ngf-select ng-model="picFile" name="file" accept="image/*" ngf-max-size="2MB" required ngf-model-invalid="errorFiles">
I should have provided a jsfiddle in the first place. Was just trying to generate one to reproduce my issue, and it forced me to realize that my code had lost the ngFileUpload injection on the module. No wonder it wasn't working. Thanks, #danial, for the nice work.
How i can use events with angularjs? i read the documentation but they dont mention anything about this only databinding and i dont want to use javascript or jquery to use this events.
<div id="treeView" ej-treeview e-fields-datasource="vm.list" e-fields-id="id" e-fields-parentid="pid" e-fields-text="name" e-fields-haschild="hasChild" e-fields-expanded="expanded" />
I try the attributes:
e-fields-options
e-field-nodeSelect
e-field-model
and nothing work.
Can anyone help me?
Thanks.
PD: Sorry for my english :(
You mean the clientside events, then you have to provide the as follows.
<div id="treeView" ej-treeview e-fields-datasource="vm.list" e-expanded="expanded" e-nodeselect="selected" />
The Syncfusion angular control properties are same as the javascript controls we have to provide the properties prefixed with 'e-' thats all its simple..:)
Well i been facing issue to conStruct a fiddle where i can explain my problem to everyone clearly . Well i done most part and i needed small assistance on helping me setting up fiddle with datepicker binded to textbox in my fiddle
My fiddle : http://jsfiddle.net/JL26Z/2/
<script id="PhoneTemplate" type="text/html">
<div> // designing template for further use
Well depends on my this resolution i can post my real issue .
Regards
Updated your Fiddle:
In your fiddle, if you are using Knockout.js , other files can be added in the External Resources Tab. You need to add jQuery UI reference to it.
Add these lines to your code.
Html :
<input type="text" id="date" />
Js :
$(document).ready(function(){
$('#date').datepicker();
});
Note : This is just an answer to include datepicker in the fiddle.
For the whole functionality you should refer this answer - Link.
I have the following: http://jsfiddle.net/mVs9T/13/
Could someone please tell me why the output is printing
<br>
instead of:
<br/>
like here: http://f.imgtmp.com/Xjoq3.png
Yes, because that is how chrome interprets the <br /> tag. It's just aesthetic; you need not worry about it.
We added alert(txt); and it gave us <br/> - looks good to go.
That's browser behaviour. It shouldn't be a problem.
Since nothing can go between a <br> tag the /> part is not necessary. This is probably why the browser doesn't display it.