• 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

    I can't use javascript libraries on dashboard designer

    How-To
    3
    6
    1.2k
    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.
    • E
      erdi.metin
      last edited by

      Hi!
      I'm trying to add a library this way

      <script src="**cdn link or js file path**" type="text/javascript"></script>
      

      Library cannot be defined in mango although it works in html file
      Just a example: i want to import jquery but I get an error like this $ is not defined

      1 Reply Last reply Reply Quote 1
      • MattFoxM
        MattFox
        last edited by

        The only way to do this is duplicate the /opt/mango/web/modules/MangoUI/web/index.html file to /opt/mango/overrides/web/modules/MangoUI/web/index.html and add your desired external libraries yourself if you're doing your own thing.
        Secondly jquery is already part of the mangoUI stack. You shouldn't have to add it.

            "jquery": "^3.3.1",
            "jquery-ui": "^1.12.1",
            "jquery-ui-touch-punch-c": "^1.4.0",
        

        What are you trying to achieve?

        Do not follow where the path may lead; go instead where there is no path.
        And leave a trail - Muriel Strode

        1 Reply Last reply Reply Quote 0
        • E
          erdi.metin
          last edited by

          @mattfox said in I can't use javascript libraries on dashboard designer:

          shouldn't

          Firstly thank you for your response,

          Can I use jquery or leaflet js or anything part of the mango in the script tag on dashboard designer? Not in Angular scope btw.
          my goal is not jquery but when i try to test it,it's not work.

          1 Reply Last reply Reply Quote 0
          • MattFoxM
            MattFox
            last edited by

            No, the whole purpose of the mangoUI system is it's an AngularJS single page application. If you want to write custom scripts you will have to write either AngularJS controllers or full blown components using the userModule option.

            There are a multitude of resources in this forum to accomplish this. If it's of any benefit, I use mapboxGLjs myself so I could probably help you get started with leaflet.
            Sorry it's not the news you wanted to hear, but it's how this system is designed...

            Fox

            Do not follow where the path may lead; go instead where there is no path.
            And leave a trail - Muriel Strode

            E 1 Reply Last reply Reply Quote 1
            • E
              erdi.metin @MattFox
              last edited by

              @mattfox I know how I can do it now at least. Thank you for your help :)

              1 Reply Last reply Reply Quote 0
              • CraigWebC
                CraigWeb
                last edited by

                Hi @erdi-metin Just BTW Mango Automation already has a map component based on leaflet.
                You can view the API documents at HTTP://localhost/ui/docs/ng-mango/ma-tile-map

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