I feel like I need to pull my hat over my head and stare at my feet after writing this, but … maybe someone will find it instructive.

I’m working on a project that uses AngularJS 1.x along with TypeScript. One bit of functionality uses REST to pull down some “notifications” that get populated via a 3rd party API into a custom list. The REST endpoint is: “http://host/_vti_bin/listdata.svc/Xyzzy()?$expand=Attachments".

In Chrome’s dev tools, the response looks something like this:

Attachments Payload

Happily, it gives us everything we need to construct a link to the attachment.

I defined an interface in TypeScript as follows:

Interface Definition for SharePoint 2010 REST Attachment. Sigh.

After some code magic and associated blah blah blah, I can write the following:

Lambda!

And finally, in my directive’s HTML:

Fun With Angular Templates

So the real point to this is that even a creaky old SP 2010 environment benefits from using some of that TypeScript mojo. Fun stuff.

</end>