Click here to Skip to main content
13,894,165 members

Web Development

 
AnswerRe: BS Carousel local images Pin
Pete O'Hanlon22-Jan-19 2:03
protectorPete O'Hanlon22-Jan-19 2:03 
GeneralRe: BS Carousel local images Pin
Member 1097549723-Jan-19 8:55
memberMember 1097549723-Jan-19 8:55 
QuestionCreating a 'design your own' feature on my website Pin
Member 1411577011-Jan-19 17:27
memberMember 1411577011-Jan-19 17:27 
AnswerRe: Creating a 'design your own' feature on my website Pin
Nathan Minier16-Jan-19 1:45
professionalNathan Minier16-Jan-19 1:45 
QuestionCreating PIVOT data not producing correct result Pin
samflex10-Jan-19 20:31
membersamflex10-Jan-19 20:31 
AnswerRe: Creating PIVOT data not producing correct result Pin
Richard Deeming11-Jan-19 2:01
mveRichard Deeming11-Jan-19 2:01 
General(Solved) Re: Creating PIVOT data not producing correct result Pin
samflex11-Jan-19 4:14
membersamflex11-Jan-19 4:14 
QuestionObject Type and HTTP JSON Gets Pin
cjb1107-Jan-19 22:04
membercjb1107-Jan-19 22:04 
I've been struggling with getting an Angular 6 app to sort the results of an WebAPI call, and it turns out that the root cause is case sensitivity on the object properties. And I can see 'where' the differing cases come from, but I can't see the where/why.

I have a class for my object:
export class App
{
  id: number;
  name: string;
  description: string;
  isEnabled: boolean;
  shortName: string;
  displayOrder: number;
}
And my web service returns JSON like:
{"ID":1
,"Name":"Matterhorn User Management"
,"Description":"User and Role management for Matterhorn applications."
,"IsEnabled":true
,"ShortName":"MUM"
,"DisplayOrder":10}
To retrieve the data I've got the following function in my service:
getApplications(): Observable<App[]>
{
  let apiURL: string = this.baseUrl + 'usermanagement/applications/read';

  return this.http.get<App[]>(apiURL);
}
And finally my component calls that service function:
getApps(): void
{
  this.appsService.getApplications()
    .subscribe(data =>
    {
      this.apps = data.sort((a, b) => a.DisplayOrder - b.DisplayOrder);
    });

}

So the problem was that data structure matches the JSON capitalization and not my local TS object one, and I had to use DisplayOrder not displayOrder (and TS now whinges at me).
But isn't Angular now supposed to map and convert JSON automatically (I know this was a specific step in the past)?
And surely your local objects don't have to match the case sensitivity of the JSON provided by others.
QuestionWordpress Website Showing Error Pin
Jack_Calder5-Jan-19 0:48
professionalJack_Calder5-Jan-19 0:48 
AnswerRe: Wordpress Website Showing Error Pin
Afzaal Ahmad Zeeshan5-Jan-19 1:51
mveAfzaal Ahmad Zeeshan5-Jan-19 1:51 
Questiontransform: skew only on one side [SOLVED] Pin
Valentinor17-Dec-18 2:49
memberValentinor17-Dec-18 2:49 
AnswerRe: transform: skew only on one side Pin
Valentinor17-Dec-18 5:40
memberValentinor17-Dec-18 5:40 
GeneralRe: transform: skew only on one side Pin
Richard Deeming17-Dec-18 9:26
mveRichard Deeming17-Dec-18 9:26 
GeneralRe: transform: skew only on one side Pin
Valentinor17-Dec-18 11:02
memberValentinor17-Dec-18 11:02 
QuestionMessage Closed Pin
14-Dec-18 2:57
memberMember 1408965614-Dec-18 2:57 
QuestionTrouble w/ Background Image Load Time Pin
Member 1208020111-Dec-18 11:35
memberMember 1208020111-Dec-18 11:35 
AnswerRe: Trouble w/ Background Image Load Time Pin
Nathan Minier12-Dec-18 4:23
professionalNathan Minier12-Dec-18 4:23 
AnswerMessage Closed Pin
6-Dec-18 4:01
memberAshishKhuraishy6-Dec-18 4:01 
AnswerMessage Closed Pin
6-Dec-18 3:59
memberAshishKhuraishy6-Dec-18 3:59 
QuestionHow to find server name Pin
_Flaviu29-Nov-18 8:48
member_Flaviu29-Nov-18 8:48 
GeneralRe: How to find server name Pin
Richard MacCutchan29-Nov-18 9:58
protectorRichard MacCutchan29-Nov-18 9:58 
Questionhtml fonts display differently Pin
dcof28-Nov-18 10:00
memberdcof28-Nov-18 10:00 
AnswerRe: html fonts display differently Pin
Richard MacCutchan28-Nov-18 21:46
protectorRichard MacCutchan28-Nov-18 21:46 
QuestionRESTful API practices in the realworld Pin
wolfbinary28-Nov-18 4:35
memberwolfbinary28-Nov-18 4:35 
AnswerRe: RESTful API practices in the realworld Pin
Richard Deeming28-Nov-18 5:48
mveRichard Deeming28-Nov-18 5:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Cookies | Terms of Service
Web05 | 2.8.190306.1 | Last Updated 18 Mar 2019
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid