Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi all,
I have a custom directive (from this post: http://our.umbraco.org/forum/umbraco-7/developing-umbraco-7-packages/60131-Localize-in-option-tag-doesnt-work?p=0#comment203829) insert into umbraco.directive.js.
But I need this directive in a package.
Does anyone know how I can do this?
I can not insert the umbraco.directive.js file in the package, because the original file from umbraco will be overwritten when you install the package.
Cheers
Sören
Now, I have create this file "umbraco.mail2cmsDirectives" in /umbraco/js:
(function() { angular.module("umbraco.directives").directive('localizeOption', function (localizationService) { return { restrict: 'A', link: function ($scope, element, attrs, controller) { var key = attrs.localizeOption; localizationService.localize(key).then(function (value) { element.text(value); }); } }; } ); })();
And insert the app.requires.push line before my controller:
app.requires.push('umbraco.mail2cmsDirectives');angular.module("umbraco").controller("Mailbox.MailboxEditController",function ($scope, $routeParams, mailboxResource, settingsResource, notificationsService, treeService, navigationService) {});
Uncaught Error: No module: umbraco.mail2cmsDirectives
He Sören,
Just add your js file to the package.manifest this will be enough.
Cheers Marcel
Hi Marcel,
yeah :) It works! Very easy! Thank you!
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
How add custom directive in package
Hi all,
I have a custom directive (from this post: http://our.umbraco.org/forum/umbraco-7/developing-umbraco-7-packages/60131-Localize-in-option-tag-doesnt-work?p=0#comment203829) insert into umbraco.directive.js.
But I need this directive in a package.
Does anyone know how I can do this?
I can not insert the umbraco.directive.js file in the package, because the original file from umbraco will be overwritten when you install the package.
Cheers
Sören
Now, I have create this file "umbraco.mail2cmsDirectives" in /umbraco/js:
And insert the app.requires.push line before my controller:
But if I reload umbraco it crashs. I get this error message in console:
He Sören,
Just add your js file to the package.manifest this will be enough.
Cheers Marcel
Hi Marcel,
yeah :) It works! Very easy! Thank you!
Cheers
Sören
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.