Hi Javier

I did this by implementing a fromJSON method on each class, which allows me to do what you describe.  By moving this to the persistent class, I don't have to worry about instantiating or accessing the object, but can just apply a JSON update to an object

The details are in https://community.intersystems.com/post/lets-write-angular-1x-app-cach%C3%A9-rest-backend-part-9

Hope this helps
Chris

Just to add a word of warning.  The syntax for %Object is only available in 2016.1, and is deprecated in favour of similar but incompatible objects and syntax in later versions.  If you have the choice of versions, it would be wisest to adopt 2016.2+ and use the DynamicObject class and methods, as this will be more futureproofed

Details are at https://community.intersystems.com/post/json-changes-cach%C3%A9-20162

HI Jennifer

I started building my application quite some time ago (over a year ago), so Angular 1.x was the best choice at the time with the support of the Material UI platform, and I didn't want to have to start again since the new version of Angular isn't compatible with the old syntax, or easy to migrate to.  However, one of the nice things about structuring the application with REST is that it is pretty straightforward to bolt a new front end, or even run a new one side by side with the old one.

Hi Joe, 

Are you using Chrome to debug?  You should be able to click through to the error on the Network tab from the Deubgger.  Anything that returns an error code should be highlighted in red, and if you click that red text, then it should give you the specific error coming from Caché.  If you get this error, I should be able to find my mistake in the exported code.

There's example of this debug process at the end of part 7.  I've also added an example logo to the github repo

Thanks

Chris

"As far as I know the only change that can't be caught by find-and-replace is the one requiring COS expressions embedded within JSON to have parentheses"


This was my understanding of the differences too, so I've (probably at my own expense) been very careful to only use the methods that I know I can do a basic Find-Replace on in the future.  So, I've been assigning the results of any COS expressions to variables, then binding these to the Dynamic objects.  It's a little more verbose, but it should allow an easier translation path between .1 and .2

Hi Jill

You busted me!  I deliberately left off the Caché Security portion of the equation because it would have gotten very complex very fast.  

The apache config info is great.  I was lucky enough to inherit a fully configured httpd instance on my dev system

Many thanks

Chris

P.S.  Chasing up why the images keep disappearing from the post, hopefully will be resolved soon

Hi Joe

The sytnax is different and incompatible unfortunately.  However, I've actually been doing all of my development against 2016.1, so the code I'm writing here is all feature compatible (I purposefully didn't explore any of the more advanced JSON functionality once I heard about the changes in the pipeline).  Essentially, the only difference is that the % calls are instead $ calls in 2016.1.  Since I've kept the logic basic, this means you should only need to convert a small amount of the code to make it compatible with 2016.1.  Stefan wrote a great summary of the functionality here, and this contains the 2016.1 versions of the syntax.  If I start referring to any new JSON functionality that does not have an equivilant syntax in 2016.1, I will make that very clear in the article

HTH

Chris

Hi Joe

My next article was going to be a debugging session, so this is a great question.  The first thing to do when Angular misbehaves is to open your browser debugger using F12, and seeing if there are any errors being logged.  The Angular errors very helpfully include a degree of self diagnosis. 

I will get the codebase up publicly (probably on github), and will post a link back on the articles

Glad you're getting some benefit from my rambling

Chris