• 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

    Duplicate an angular directive...

    User help
    2
    5
    1.7k
    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.
    • B
      BobDay
      last edited by

      Hi Jared,

      I need to duplicate a directive (tankLevel). I did so in the /directives directory, and declared it in ngMango, but i doesn't show up when I use it (the re-named duplicate, that is). Obviously missed something...

      I then tried pasting it into a user module, and it saved it in /rest/v2/file-stores/public/renamedFile.js, but there's no User Modules tab in the menu.

      Any way to simply copy a directive/service/whatever? Thanks!

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

        @bullitbd said in Duplicate an angular directive...:

        I need to duplicate a directive (tankLevel). I did so in the /directives directory, and declared it in ngMango

        As you discovered that is not the ideal way to add your own directive.

        @bullitbd said in Duplicate an angular directive...:

        I then tried pasting it into a user module, and it saved it in /rest/v2/file-stores/public/renamedFile.js

        That is fine but you can't just use a directive file as a user module. You can use a user module to load the directive in your other file if you wish but don't point the user module setting to this file.

        @bullitbd said in Duplicate an angular directive...:

        but there's no User Modules tab in the menu.

        The user module setting is under Administration -> UI Settings -> User module URL.

        Please see my other posts on user modules for more details:
        https://forum.infiniteautomation.com/search?term=usermodule&in=titlesposts

        Developer at Radix IoT

        B 1 Reply Last reply Reply Quote 0
        • B
          BobDay @Jared Wiltshire
          last edited by

          @jared-wiltshire aha. so I need to actually have a "userModule" registered. Ok - could you enlighten me further? how might I use this to load 'tankLevelDup.js', and where is the best place/path to store that directive file? Thank you again...

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

            @bullitbd I have posted about this topic many times, please see the results from the search I posted above.

            Developer at Radix IoT

            1 Reply Last reply Reply Quote 0
            • B
              BobDay
              last edited by

              Thanks for that @jared. I'm guilty here of one of my pet peaves - people not reading the whole email... Sorry for the unnecessary communication.

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