Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.
Using my own AngularJS Directives in Custom Dashboards
-
Hi,
I have previous experience using AngularJS and would like some of my work to be reused. How can I register an AngularJS directive for use in a custom dashboard?
Regards,
Gary
-
Hi @gary
Assuming you are using Mango v3, you can register a user AngularJS module from the UI settings page
/ui/administration/ui-settings(its at the bottom)If you click the paper clip icon you can upload a JS file


Heres a sample user module JS file
define(['angular', 'require'], function(angular, require) { 'use strict'; var userModule = angular.module('userModule', ['maUiApp']) .directive('userHello', [function() { return { template: 'Hello, url is ' + require.toUrl('.') + ' {{$ctrl.testText}}', controller: angular.noop, controllerAs: '$ctrl', bindToController: { testText: '@' } } }]); return userModule; }); // define -
Thank you, @Jared-Wiltshire. That's excellent, I shall give that a go.
-
@gary said in Using my own AngularJS Directives in Custom Dashboards:
Thank you, @Jared-Wiltshire. That's excellent, I shall give that a go.
I forgot to mention that the file uploader is a new feature, so make sure you update your Core and UI module.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login