diff --git a/src/Umbraco.Web.UI.Client/src/common/resources/content.resource.js b/src/Umbraco.Web.UI.Client/src/common/resources/content.resource.js index 509e5ad01e..feecdac18c 100644 --- a/src/Umbraco.Web.UI.Client/src/common/resources/content.resource.js +++ b/src/Umbraco.Web.UI.Client/src/common/resources/content.resource.js @@ -382,8 +382,8 @@ function contentResource($q, $http, umbDataFormatter, umbRequestHelper) { * * ##usage *
- * contentResource.getNiceUrl()
- * .then(function(stylesheets) {
+ * contentResource.getNiceUrl(id)
+ * .then(function(url) {
* alert('its here!');
* });
*
@@ -401,6 +401,35 @@ function contentResource($q, $http, umbDataFormatter, umbRequestHelper) {
'Failed to retrieve url for id:' + id);
},
+ /**
+ * @ngdoc method
+ * @name umbraco.resources.contentResource#getPath
+ * @methodOf umbraco.resources.contentResource
+ *
+ * @description
+ * Returns a url, given a node ID
+ *
+ * ##usage
+ *
+ * contentResource.getPath(id)
+ * .then(function(pathArray) {
+ * alert('its here!');
+ * });
+ *
+ *
+ * @param {Int} id Id of node to return the public url to
+ * @returns {Promise} resourcePromise object containing the url.
+ *
+ */
+ getPath: function (id) {
+ return umbRequestHelper.resourcePromise(
+ $http.get(
+ umbRequestHelper.getApiUrl(
+ "contentApiBaseUrl",
+ "GetPath",[{id: id}])),
+ 'Failed to retrieve path for id:' + id);
+ },
+
/**
* @ngdoc method
* @name umbraco.resources.contentResource#getChildren
diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj
index 27b1333375..847f23aef5 100644
--- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj
+++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj
@@ -622,7 +622,9 @@