Ionic Jade mask text input - ionic-framework

I'm building an iOS app using Ionic and am using Jade for UI. There is an input box that I want the value typed to be masked. The input could be numeric or numeric+alphabetical. So far, I couldn't find how to do it.
Anyone can help what should I do to mask the input while user is typing? For example, if user type '123', what should be shown in UI is 'XXX'. And I would need the unmasked value as well when I submit to API.
Any example would be useful as well since I'm not too familiar with ionic and jade.
UPDATE:
it is like the password input text field. When user types in the password, in the UI, instead of the real character typed by user, you will see "...." or "XXXX"...this is the effect that I want.

For mask you can use
npm angular2-text-mask
In input set:
[textMask]="{mask: mask, guide: false, modelClean: true}"
In .ts file set rgex :
mask: any[] = ['+', /\d/, ' ', '(', /[1-9]/, /\d/, /\d/, ')', ' ', /\d/, /\d/, /\d/, '-', /\d/, /\d/, '-', /\d/, /\d/];

Related

Issue with eval_in_page - Trying to interpolate an array

my #para_text = $mech->xpath('/html/body/form/table/tbody/tr[2]/td[3]/table/tbody/tr[2]/td/table/tbody/tr[3]/td/div/div/div', type => $mech->xpathResult('STRING_TYPE'));
#BELOW IS JUST TO MAKE SURE THE ABOVE CAPTURED THE CORRECT TEXT
print "Look here: #para_text";
$mech->click_button( id => "lnkHdrreplyall");
$mech->eval_in_page('document.getElementsByName("txtbdy")[0].value = "#para_text"');
In the last line of my code I need to put the contents of the #para_text array as the text to output into a text box on a website however from the "document" till the end of the line it needs to be surrounded by ' ' to work. Obviously this doesnt allow interpolation as that would require " " Any ideas on what to do?
To define a string that itself contains double quotes as well as interpolating variable values, you may use the alternative form of the double quote qq/ ... /, where you can choose the delimiter yourself and prevent the double quote " from being special
So you can write
$mech->eval_in_page(qq/document.getElementsByName("txtbdy")[0].value = "#para_text"/)

How to make title interpret only part of a title string in Matlab

I'm creating a plot where I want to combine two strings into a title. I want to color the other part of my string. Here is my code (it will explain itself better):
title([csv_name ', {\color{blue}Bowel AUC: ' num2str(bowelAUC) ' }'])
In the variable csv_name I have a filename containing underscore _ characters and in the variable bowelAUC I have a number. I can color only part of my title string by using the guide in this post, that is using tex, but the problem now is that tex interpreter would also interpret the csv_name variable and I don't want this. Here you can see what I get:
The filename looks like this: ExportedPressure_130A_10-29-2014.csv
So I want title to interpret only the second part of my title, not the first...how to do this?
You need to replace _ by \_ so that TeX interprets them correctly. To do that you can use regexprep (note that within regexprep both characters are escaped again):
csv_name_escaped = regexprep(csv_name, '\_', '\\\_');
title([csv_name_escaped ', {\color{blue}Bowel AUC: ' num2str(bowelAUC) ' }'])

Show text box when press push button

How to show a text box when I press a push button?
for example I have variable
set(handles.edNama2,'String',nama);
Value of nama is Elisabeth
My Push Button variable is DataPribadi
I want the text box to show with the personal data of Elisabeth
This creates text box:
handles.edNama2 = annotation('textbox', [your_position_of_the_text_box_here]);
set(handles.edNama2, 'String', ['He needs ', num2str(10), ' $USD!!!']);
This opens new message box for you:
msgbox(['I want ', num2str(1e+6), ' $USD']);
So you can put your info in the [], remember to convert to String type.

Splitting unicode sentence into words array using XRegExp

I'm using following script for splitting Unicode sentence into words array.
XRegExp.matchChain("læseWEB læser teksten på dit website op.", [XRegExp("[\\p{Alphabetic}\\p{Nd}\\{Pc}\\p{M}]+", "g")])
[ "læseWEB", "læser", "teksten", "på", "dit", "website", "op" ]
Now I'm expecting
['læseWEB ', 'læser ', 'teksten ', 'på ', 'dit ', 'website ', 'op.'].
Someone said I need to use split function instead of matchChain.
Any suggestions?

How to write value into text node in DOM?

<div><p></p></div>
I found when put in ,
$('div')[0].childNodes
it split the text node of into 2 text nodes,
#=>[textnode,<p></p>,textnode]
if I want write the text 'this is text node 3' into the last child node,
something like:
('div')[0].childNodes[2].value = 'this is text node 3'
but value property doesn't work here.how can I do this?
Instead of using .value try this the following, and give us feedback if it works.
$('div')[0].childNodes[2].innerHTML = 'this is text node 3';