angular directive replace newline with html
I am using a service to retrieve data which binds to the html like this
{{order.Notes}}
order.Notes may contain multi-line text so i would like to format it using
html tags 'br'
This is the directive i'm trying to use:
angular.module('directives', [])
.directive('htmlText', function () {
return {
restrict: 'E',
template: '<div ng-bind-html-unsafe="html"></div>',
scope: {
text: '='
},
link: function (scope, elem, attrs) {
var updateText = function () {
if (scope.text != null) {
scope.html = scope.text.replace('\n', "<br/>");
}
};
scope.$watch('text', function (oldVal, newVal) {
if (newVal) {
updateText();
}
});
}
};
});
<html-text text="order.Notes"></html-text>
however, newVal is always null. what am i missing here?
Monday, 2 September 2013
what technology should be used to describe a story or news?
what technology should be used to describe a story or news?
I'm studying semantic web on my research, and it has limitation to present
a story or news, it is used to present the details of a resource.
So if i want to present a story or news in machine readable format, where
should i start?
Thanks
I'm studying semantic web on my research, and it has limitation to present
a story or news, it is used to present the details of a resource.
So if i want to present a story or news in machine readable format, where
should i start?
Thanks
How can I increment a variable using a loop while using another loop at the same time?
How can I increment a variable using a loop while using another loop at
the same time?
I need to use j as a counter and increment it at the same time the i
increments. This code just keep on giving me random number for j. Help?
int i, j;//counters
for (i=0, j=1; i<=LENGTH; i++, j++)
{
printf("Player %i "\n", j);
printf("Name:\t");
fgets(name[i], MAXLENGTH, stdin);
...
the same time?
I need to use j as a counter and increment it at the same time the i
increments. This code just keep on giving me random number for j. Help?
int i, j;//counters
for (i=0, j=1; i<=LENGTH; i++, j++)
{
printf("Player %i "\n", j);
printf("Name:\t");
fgets(name[i], MAXLENGTH, stdin);
...
Mono GUI Application is going to hang after moving tab from one window to another window
Mono GUI Application is going to hang after moving tab from one window to
another window
I have Ubuntu 12.04 and mono 2.10.8 in my Linux PC.
I am running one .NET binary using mono on my Linux platform PC and it is
working fine on process startup.
But when i moved my running GUI window to another window and get back to
that windows at that time , My GUI Application goes into the hang state
because i can not press any button on My GUI window.
I have also used all the optimization option step by step while running
.NET binary using mono but still causes the GUI hang issue.
I have debug my .NET binary with some debugging options and found that
whenever GUI window application goes into stuck condition at that GDIplus
library code is running. so, it seems that there is something is going
wrong into the GDIplus library.
does any one have idea what is happening here or any one have faced this
issue before?
Please let me know if anyone need any more information and give valuable
feedback as sson as possible.
another window
I have Ubuntu 12.04 and mono 2.10.8 in my Linux PC.
I am running one .NET binary using mono on my Linux platform PC and it is
working fine on process startup.
But when i moved my running GUI window to another window and get back to
that windows at that time , My GUI Application goes into the hang state
because i can not press any button on My GUI window.
I have also used all the optimization option step by step while running
.NET binary using mono but still causes the GUI hang issue.
I have debug my .NET binary with some debugging options and found that
whenever GUI window application goes into stuck condition at that GDIplus
library code is running. so, it seems that there is something is going
wrong into the GDIplus library.
does any one have idea what is happening here or any one have faced this
issue before?
Please let me know if anyone need any more information and give valuable
feedback as sson as possible.
NSString componentsSeparatedByString after that values i need to show in one label
NSString componentsSeparatedByString after that values i need to show in
one label
I friends,
I have some values in one string how can i split that string values
separately i need to show in one label , dis my values i got in nsstring
values showing ( "", "user_currency_code=USD", "user_currency_symbol=$",
"usertypecode=ROBT", "player_level=1", "player_isblocked=false",
"lang=en", "respond=true", "flylogin=false", "str=PageEnd",
"user_balance=100000394.90", "user_bonus_balance=0.00", "first_name=test",
"cash_balance=100000394.90", "coupon_balance=0.00", "str=PageEnd",
"remain_GameCount=0", "remain_PTAmount=0.00",
"real_user_balance=100000394.90", "fun_user_balance=95725.15",
"user_bonus_balance=0.00", "bonusstatus=false", "bonus_id=null" )
in dis value separately i need to show all separate labels example
currency code values ,i need to show one label in dis label it will
display like dis USD. Like that i need to get all values and show in each
label
one label
I friends,
I have some values in one string how can i split that string values
separately i need to show in one label , dis my values i got in nsstring
values showing ( "", "user_currency_code=USD", "user_currency_symbol=$",
"usertypecode=ROBT", "player_level=1", "player_isblocked=false",
"lang=en", "respond=true", "flylogin=false", "str=PageEnd",
"user_balance=100000394.90", "user_bonus_balance=0.00", "first_name=test",
"cash_balance=100000394.90", "coupon_balance=0.00", "str=PageEnd",
"remain_GameCount=0", "remain_PTAmount=0.00",
"real_user_balance=100000394.90", "fun_user_balance=95725.15",
"user_bonus_balance=0.00", "bonusstatus=false", "bonus_id=null" )
in dis value separately i need to show all separate labels example
currency code values ,i need to show one label in dis label it will
display like dis USD. Like that i need to get all values and show in each
label
Sunday, 1 September 2013
Is this the appropriate way to set up SSL on the latest version of Node.js Express?
Is this the appropriate way to set up SSL on the latest version of Node.js
Express?
var ssl_key = fs.readFileSync('./production/ssl/dev/domain.key').toString();
var ssl_cert =
fs.readFileSync('./production/ssl/dev/domain.com.crt').toString();
var ssl_ca =
fs.readFileSync('./production/ssl/dev/gd_bundle.crt').toString();
var options = {
key: ssl_key,
cert: ssl_cert,
ca: ssl_ca
}
var app = express(options);
app.get('/', function(req,res){
res.send('hello');
});
app.listen(443);
I generated my CSR correctly, pasted it into Godaddy, and got the
certificates back.
When I go to my website, I got: SSL Connection Error.
Unable to make a secure connection to the server. This may be a problem
with the server, or it may be requiring a client authentication
certificate that you don't have.
Error code: ERR_SSL_PROTOCOL_ERROR
Does it take 24 hours wait or something? Or is my code incorrect? I set it
up 30 minutes ago...
Express?
var ssl_key = fs.readFileSync('./production/ssl/dev/domain.key').toString();
var ssl_cert =
fs.readFileSync('./production/ssl/dev/domain.com.crt').toString();
var ssl_ca =
fs.readFileSync('./production/ssl/dev/gd_bundle.crt').toString();
var options = {
key: ssl_key,
cert: ssl_cert,
ca: ssl_ca
}
var app = express(options);
app.get('/', function(req,res){
res.send('hello');
});
app.listen(443);
I generated my CSR correctly, pasted it into Godaddy, and got the
certificates back.
When I go to my website, I got: SSL Connection Error.
Unable to make a secure connection to the server. This may be a problem
with the server, or it may be requiring a client authentication
certificate that you don't have.
Error code: ERR_SSL_PROTOCOL_ERROR
Does it take 24 hours wait or something? Or is my code incorrect? I set it
up 30 minutes ago...
Paste Line to Notepad for a file, if it is opened by user
Paste Line to Notepad for a file, if it is opened by user
i am creating a logging mechanism for my program , where i have to log
data in to a file, whose location and name is specified by users.
I am doing the logging using stream writer as follows-
StreamWriter writer = Writer ?? File.AppendText(FileName);
writer.WriteLine(DateTime.Now + " " + text);
writer.Flush();
writer.Close();
But if user opens the file while my program is running , the newly logged
lines are not visible to user until the user close and reopens the file,
Is their any way i can overcome this behavior and user is also able to see
the newly logged lines when file is open.
i am creating a logging mechanism for my program , where i have to log
data in to a file, whose location and name is specified by users.
I am doing the logging using stream writer as follows-
StreamWriter writer = Writer ?? File.AppendText(FileName);
writer.WriteLine(DateTime.Now + " " + text);
writer.Flush();
writer.Close();
But if user opens the file while my program is running , the newly logged
lines are not visible to user until the user close and reopens the file,
Is their any way i can overcome this behavior and user is also able to see
the newly logged lines when file is open.
Subscribe to:
Posts (Atom)