|
Sure I will use it, thanks for bringing this into my notice, I have been using this site for a long time, maybe young people like you learn faster .God bless you Karthik.
Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
|
|
|
|
|
Hi,
I changed it in the below way but still the
{{cust.Name}} - {{cust.City}} are giving me null values, web page is not showing any values against them.
Can you please help me why is it not showing me any values for cust.Name and cust.City?
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" data-ng-app="myapp">
<head>
<title>Using AngularJS Directives and Data Binding</title>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
</head>
<body data-ng-init="names=['Abdul Aleem', 'Farha Tabassum', 'Abdul Muqtadir', 'Abdul Malik']">
Name :
<br />
<input type="text" data-ng-model="name" />{{name}}
<br />
<ul>
<li data-ng-repeat="personName in Names" > {{personName}} </li>
</ul>
<pre>
<div class="container" data-ng-controller="SimpleController">
<h3>Adding a Simple Controller</h3>
<ul>
<li data-ng-repeart="cust in customers">
{{cust.Name}} - {{cust.City}}
</li>
</ul>
</div>
<script>
var app = angular.module('myapp', []);
app.controller('SimpleController',
function SimpleController($scope) {
$scope.customers = [
{ Name: 'AA', City: 'Sacramento' },
{ Name: 'AB', City: 'Plano' },
{ Name: 'AC', City: 'Freemont' },
{ Name: 'AD', City: 'Nalgonda' },
{ Name: 'AE', City: 'Nalgonda' }
];
});
</script>
</body>
Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
|
|
|
|
|
 try this, your task to find the difference
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" data-ng-app="myapp">
<head>
<title>Using AngularJS Directives and Data Binding</title>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
</head>
<body data-ng-init="names=['Abdul Aleem', 'Farha Tabassum', 'Abdul Muqtadir', 'Abdul Malik']">
Name :
<input type="text" data-ng-model="name" />{{name}}
<ul>
<li data-ng-repeat="personName in names"> {{personName}} </li>
</ul>
<div class="container" data-ng-controller="SimpleController">
<h3>Adding a Simple Controller</h3>
<ul>
<li data-ng-repeat="cust in customers">
{{cust.Name}} - {{cust.City}}
</li>
</ul>
</div>
<script>
var app = angular.module('myapp', []);
app.controller('SimpleController', function SimpleController($scope) {
$scope.customers = [
{ Name: 'AA', City: 'Sacramento' },
{ Name: 'AB', City: 'Plano' },
{ Name: 'AC', City: 'Freemont' },
{ Name: 'AD', City: 'Nalgonda' },
{ Name: 'AE', City: 'Nalgonda' }
];
});
</script>
</body>
</html>
|
|
|
|
|
Yes I found them, they are spelling mistakes Thank you Karthik
Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
|
|
|
|
|
|
I have this function that writes HTML5 in a MVC View, then it populates the 5 select elements.
But I want to make sure the elements are populated first before I set the data record in it.
I have a problem with the last select element not having it's value selected, so I suspect the options haven't completed yet.
So I tried this, but it won't magically work without me modifying each function with a promise or something.
The first promise was easy to figure out, but adding a promise to my $Ajax function seems more complicated.
I have no clue how to add the promise to the 3nd code sample.
load_cardData_update_record(_paymentID) // Final Ajax call is the final $Ajax call that grabs the record.
Maybe I'm going about this wrong. Perhaps I should grab the record first before writing all this HTML to the DOM.
$uContainer.empty().html(uElements).show().promise().done(function (arg1) {
select_cardBrands('CreditDebitRecord_Update_Card_Brand');
select_expMonths('CreditDebitRecord_Update_Card_ExpMonth');
select_expYears('CreditDebitRecord_Update_Card_ExpYear');
load_updateCard_countryCodes();
load_updateCard_stateCodes("US");
$.when( select_cardBrands(), select_expMonths(), select_expYears(), load_updateCard_countryCodes(), load_updateCard_stateCodes() ).then(load_cardData_update_record(_paymentID));
$("#CreditDebitRecord_Update_BillingAddress_CountryCode").change(function () {
var _countryCode = $("#CreditDebitRecord_Update_BillingAddress_CountryCode option:selected").val();
load_updateCard_stateCodes(_countryCode);
});
$("#CreditDebitRecord_Update_Card_Name").focus();
});
And a sample function that uses $Ajax and needs a promise.
function select_cardBrands(_parent) {
var $select = $('#' + _parent),
option = '';
$.ajax({
type: "POST",
cache: false,
dataType: "json",
url: '/Ajax/json_select_load_cardBrands',
data: { },
error: function (response) {
debugger;
alert("http code: " + response.status + " Error: json_select_load_cardBrands - data: " + response);
$e_UpdateCreditDebit.toggleClass('active');
},
success: function (data) {
for (var x = 0; x < data.length; x++) {
option += '<option value="' + data[x].value + '">' + data[x].text + '</option>';
}
$select.html(option);
}
});
}
|
|
|
|
|
OK, that was difficult to understand. But is needed so teh form doesn't fail on the user.
Any comments, would you do it different?
$uContainer.empty().html(uElements).show().promise().done(function (arg1) {
var promise_cardBrands = select_cardBrands('CreditDebitRecord_Update_Card_Brand');
promise_cardBrands.done(function () {
select_expMonths('CreditDebitRecord_Update_Card_ExpMonth');
select_expYears('CreditDebitRecord_Update_Card_ExpYear');
var promise_Countries = load_updateCard_countryCodes();
promise_Countries.done(function () {
var promise_States = load_updateCard_stateCodes("US");
promise_States.done(function () {
var promise_Record = load_cardData_update_record(_paymentID);
});
});
});
$("#CreditDebitRecord_Update_BillingAddress_CountryCode").change(function () {
var _countryCode = $("#CreditDebitRecord_Update_BillingAddress_CountryCode option:selected").val();
load_updateCard_stateCodes(_countryCode);
});
$("#CreditDebitRecord_Update_Card_Name").focus();
});
function load_updateCard_stateCodes(_countryCode) {
var $e_StateCode = $("#CreditDebitRecord_Update_BillingAddress_StateCode"),
procemessage = "<option value='0'> Please wait...</option>",
deferred = new $.Deferred();
if (_countryCode !== '--') {
$e_StateCode.html(procemessage).show();
$.ajax({
type: "POST",
cache: true,
dataType: "json",
url: '/Ajax/load_StateCodes',
data: { CountryCode: _countryCode },
error: function (response) {
debugger;
alert("http " + response.status + " Error: load_stateCodes - data: " + response);
},
success: function (data) {
var markup = "<option value='--'>Select State / Province</option>";
for (var x = 0; x < data.length; x++) {
markup += "<option value=" + data[x].value + ">" + data[x].text + "</option>";
}
$e_StateCode.html(markup).show();
deferred.resolve("finished");
}
});
}
return deferred.promise();
}
|
|
|
|
|
I don't think that I would chain the promises quite like that, since it'll be hard to do anything with it down the road and it forces asynchronous operations into a synchronous format.
I'd personally use a tracking object as a pre-load sentinel for your primary business object, pass an update/check callback to the resolution of each async call, and send them all off at once. This also gives the capability of seeing which particular calls might fail, rather than have the whole bundle collapse in on itself if there's an issue.
An example might look like:
var loadTracker = {
track1: false;
track2: false;
track3: false;
track4: false;
}
function doSomething(promiseItemName)
{
loadTracker[promiseItemName] = true;
if(loadTracker.track1 && loadTracker.track2 && loadTracker.track3 && loadTracker.track4){
doThePromiseDependentThing();
}
}
track1Promise.done(function(){
doSomething('track1');
});
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
I'll take your advice on that!. But will wait for 1 more vote on that.
And my idea didn't work on my iphone 6s+
|
|
|
|
|
All good. That's a pretty quick and dirty construct which can be greatly (and easily) improved.
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
Alright, I fixed my iPhone issue so I will make an attempt now to implement your concept.
Thanks!, I'll up vote it when I'm done.
|
|
|
|
|
I am looking for an API that is similar to YouTube Help popup window.
The popup window can be seen on clicking the Help link on the footer of YouTube homepage. The screenshot of it is attached here
Basically I need the API for documentation that looks and works similar to this, having a search box on the top and a Markdown for writing/managing the content
Thanks
|
|
|
|
|
is there any way to know that web page has thrown any error.
i.e. i am using some api and it throws some error in background i.e. on console.
so i want to do like this. if on page myPage.html is there any error thrown by server or js or api or any other thing i want to show alert box.
i tried to add on error event on body of html element but it does not work.
|
|
|
|
|
rorschach217 wrote: but it does not work. Please do not expect people to understand what that is supposed to mean. If you have a problem then edit your question and add some proper details.
|
|
|
|
|
From your title , my understanding is that you want to handler browser error in javascript but when I read your description , you are contradicting yourself.
You need to understand that Javascript can only handle client scripting errors not server errors unless you pass something in a client script to talk to your javascript code.
There are lot of techniques you can find if you google it.
|
|
|
|
|
Hi Everyone.
I am trying to save multiple rows from angular UI grid to a database using for loop. I am calling controller action method using http.post. Could anyone help me out in guiding how to save multiple rows using http request.
Thanks
Syed
|
|
|
|
|
Just put your call into a loop. Sounds like you already have a loop so where is the problem?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Server call in a loop could lead to performance issue. Add them in to JSON Array in a loop and pass it to server call at the end.
|
|
|
|
|
help me writing a small program
|
|
|
|
|
Do not repost.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
main(){} small enough?
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
|
hi
i wrote a code for the 2nd part in the following.
but i dont know where am i going wrong. need help.
Create a new Java Project in Eclipse named HW6_lastName and complete the following requirements based on the Threads. Several threads will share a single object and contribute their individual result to the shared object. The shared object accumulates the partial results.
Create a package named cs520.hw6. Using this package, create the following classes.
Create a class named SharedResults as follows. The class keeps track of the shared result.
The instance (or member) private variable – result (int).
A void addToResultmethod which takes the given integer argument and adds it to the shared result. This method then prints to the console the name of the current thread, the value it added, and the cumulative result. Handle the synchronization issue with this method.
The getResult method with no arguments which returns the shared result. Handle the synchronization issue with this method.
2. Create a class named LongTask which extends the Thread class.
a.The instance (or member) private variables – sharedData (of type SharedResults), start (integer) and end (integer).
b.A single constructor which takes the above three arguments and stores them in the instance values. Also, create a name for this thread as Thread_<start>_<end>
c.In the run method, add the integer numbers from start to end (both inclusive) using a for loop. Also, sleep for a random time (up to 10 milliseconds) in each iteration of the loop. After the loop, invoke the addToResult method of the shared object and provide this accumulated sum.
Create a Test class to test the following functionality in its main method.
a.Create the SharedResults object and assign it to a variable.
b.Create five LongTask objects by passing the above shared object and the start and end values for each as (1, 100), (101, 200), (201, 300), (301, 400), and (401, 500) respectively.
c.Start each thread as it is created.
d.Wait for all the threads to complete using the join method.
e.Print the result from the shared object.
Sample Output:
Create an archive of your Eclipse project using the following steps. Select the HW6_lastName project in the Eclipse IDE’s Package Explorer or the Navigator window.
Click File->Export. Select the General->Archive File option. Click Next.
Specify the "To archive file:" entry as say, C:TempHW6_lastName.zip.
The zip file will be created and stored in the C:Temp folder.
Submit this zip file as an attachment in the Assignment Section of Vista.
|
|
|
|
|
small... xD 
|
|
|
|
|
We do not do the homeworks, because you have to do that yourself.
However, if you also include the problem that you are encountering then we can guide you, if that is a technical problem. Mostly, the problems are basic such as NullPointerException etc. and others. So, try to add the error messages and what you were expecting, so that we can guide.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|