I am creating a custom plugin for Umbraco 7, I need to find the parentId via my javascript, so I tried using editorState.current, but this is always null.
editorState is correctly initialized, but the property current is always null.
angular.module("umbraco").controller("CatalogueEditController",
function ($scope, editorState) {
console.log(editorState.current);
Try and debug in visual studio. Set a break point when u initialize angular.module and then when you load in your editorState, check it and make sure it is sending some value and that editorState is actually receiving those values, also what do you want with current, if you want the id why write editorState.current.id ?
editorState.current is always null, so I cannot get the Id :). I actually need the parent id.
I already debugged in my VS. Editorstate is correctly initialized, but the current property is always null, I tried finding where this property is set, but no luck.
According to http://umbraco.github.io/Belle/#/api/umbraco.services.editorState editorState is just the state of the Editor... Funny enough :P that is passed in, so not anything you and control. But i also read that it is a read only property, so what happens if you try and assign it to a variable, and then console.log that value ?
Already did that too, found a topic that a person added the editorState to $scope.editorState and then did console.log to the $scope.editorState property, ,but again, no luck there too :/.
I added some extra query parameters for now, but I would love to get my data from the editorState and not url parsing
editorState.current is always null custom plugin
Hi,
I am creating a custom plugin for Umbraco 7, I need to find the parentId via my javascript, so I tried using editorState.current, but this is always null. editorState is correctly initialized, but the property current is always null.
Does someone knows what I am doing wrong?
Thanks! :)
Is current not supposed to be with a capital C as in Current ? i am guessing it is a dynamic property so you have no intellisense
Hi, sorry, its indeed whitout a capital C, I tried with both though, just a bad habit to start with a capital letter. Still the property is null :(
Try and debug in visual studio. Set a break point when u initialize angular.module and then when you load in your editorState, check it and make sure it is sending some value and that editorState is actually receiving those values, also what do you want with current, if you want the id why write editorState.current.id ?
editorState.current is always null, so I cannot get the Id :). I actually need the parent id. I already debugged in my VS. Editorstate is correctly initialized, but the current property is always null, I tried finding where this property is set, but no luck.
According to http://umbraco.github.io/Belle/#/api/umbraco.services.editorState editorState is just the state of the Editor... Funny enough :P that is passed in, so not anything you and control. But i also read that it is a read only property, so what happens if you try and assign it to a variable, and then console.log that value ?
Already did that too, found a topic that a person added the editorState to $scope.editorState and then did console.log to the $scope.editorState property, ,but again, no luck there too :/. I added some extra query parameters for now, but I would love to get my data from the editorState and not url parsing
Little late, but anyway...
You can use:
is working on a reply...