• Recent
    • Tags
    • Popular
    • Register
    • Login

    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.

    Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website Mango 5 Documentation Website

    Using my own AngularJS Directives in Custom Dashboards

    User help
    2
    4
    2.1k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G
      gary
      last edited by

      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

      1 Reply Last reply Reply Quote 0
      • Jared WiltshireJ
        Jared Wiltshire
        last edited by

        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
        0_1497981124008_fd4cea7d-e189-4d91-b0f3-52374b92636b-image.png

        0_1497981204566_1f33c76e-374c-4a31-b1ce-c682936020dc-image.png

        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
        

        Developer at Radix IoT

        1 Reply Last reply Reply Quote 1
        • G
          gary
          last edited by

          Thank you, @Jared-Wiltshire. That's excellent, I shall give that a go.

          Jared WiltshireJ 1 Reply Last reply Reply Quote 0
          • Jared WiltshireJ
            Jared Wiltshire @gary
            last edited by

            @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.

            Developer at Radix IoT

            1 Reply Last reply Reply Quote 0
            • First post
              Last post