I would like to extend the dateTimePickerController which is implemented in the umbracoControllers. It's only about adding two lines of code to be able to hide the date picker in certain cases.
Actually I just created a plugin which will overwrite that controller with the current source code of the dateTimePickerController and those additionals lines... Which are in the body of the function :
function dateTimePickerController($scope, notificationsService, assetsService, angularHelper, userService, $element, dateHelper)
{
// Original Config initialization
// ....
if ($scope.model.config.format == "HH:mm:ss")
{
config.pickDate = false;
config.pickTime = true;
}
// ....
// Rest of the code
}
is there any way to extend the original function dateTimePickerController by just adding that piece of code ?
I wouldn't modify the built-in editor, as they get changed over releases.
If you really really want to do so, you could just alter the source code of the propertyeditor. ... hides and runs away ...
What I do suggest is to create a new property editor based on this one.
You need the template and the controller code (here) for your new editor (and add your additional lines). And this tutorial is how you create an editor.
I do not think there's a way to just say "go to this controller and inject this code at line xy". Correct me if I am wrong.
Extending angular module
Hi,
I would like to extend the dateTimePickerController which is implemented in the umbracoControllers. It's only about adding two lines of code to be able to hide the date picker in certain cases.
Actually I just created a plugin which will overwrite that controller with the current source code of the dateTimePickerController and those additionals lines... Which are in the body of the function :
is there any way to extend the original function dateTimePickerController by just adding that piece of code ?
I wouldn't modify the built-in editor, as they get changed over releases.
If you really really want to do so, you could just alter the source code of the propertyeditor. ... hides and runs away ...
What I do suggest is to create a new property editor based on this one.
You need the template and the controller code (here) for your new editor (and add your additional lines). And this tutorial is how you create an editor.
I do not think there's a way to just say "go to this controller and inject this code at line xy". Correct me if I am wrong.
So, just create a custom editor ;-)
is working on a reply...