A reason why I hate Angular, I mean Javascript

So, I was working on this to learn how to get WebAPI to work with Angular.

No matter how I answered questions, it always came back incorrect, even when I verified that it was correct.  I was debugging in VS 2015 RC against Google Chrome, and it wasn’t stepping into the javascript.  I don’t know why.  I don’t care.

I finally (for the hell of it) switched to IE.  Suddenly, I could step in.  That was good.

Here’s the javascript in question:

$scope.correctAnswer = (data === "true");

Can you figure out the error? You don’t need to know what the WebAPI controller returns. I mean, you do, but if you look at it, you can figure it out.

That’s right. data === “true” is significantly different from data === true.

Now, once I stepped in, I could figure it out in a second (or three).  But a compile time error would have been nice (yes, I know, I’m old).

Does Typescript work with Angular?

posted on Saturday, June 06, 2015 1:56 AM Print
No comments posted yet.

Post Comment

Title *
Name *
Comment *  
Please add 7 and 1 and type the answer here: