Creating a Custom Property Editor - Get current content page Id?

I’ve created custom sections, list-views, all pulling in data from custom database tables.

For my next trick, I’m looking to create a Property editor that pulls in/saves data to a custom table with the associated page Id.

I’m just not sure how to pass the current page id to my Angular functions in order to call the correct data. Forgive me for being such an Angular newb. I’m slowly getting there!

So, for example I’m envisioning having to specify an angular resource such as:

angular.module("umbraco.resources")
	.factory("bookingResource", function ($http) {
	    return {
	        getItemsById: function (id) {
	            return $http.get("backoffice/BookingsAdmin/BookingsApi/GetItemsById?id=" + id);
	        }
	    };
	});

So this will call the appropriate backoffice APIController. I just can’t for the life of me think of how to pass the current page Id there?


This is a companion discussion topic for the original entry at https://our.umbraco.com/forum/72821-creating-a-custom-property-editor-get-current-content-page-id