Search code examples
angularjsangular-materialjustgage

Getting justgage to work with angular material


I am trying to get just gage to work with angular material. I have followed the setup instructions provided in just gage site. Below is the code pen link. Would like to know where I'm going wrong.

<div id="gauge" class="200x160px"></div>
<script>
  var g = new JustGage({
    id: "gauge",
    value: 67,
    min: 0,
    max: 100,
    title: "Visitors"
  });
    </script>

http://codepen.io/anon/pen/JKWORP


Solution

  • As @camdem_kid posts in a comment, your codepen is showing lots of errors. So, I've decidded to create a plunker from scratch where you can see working together angular-material and justgage.

    See working plunker

    Just for reference (see the plunker for the complete details)

    <html>
    
    <head>
      <link rel="stylesheet" href="https://rawgit.com/angular/bower-material/master/angular-material.css">
    
      <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular.min.js"></script>
      <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular-animate.min.js"></script>
      <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular-aria.min.js"></script>
      <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular-messages.min.js"></script>
    
      <script src="https://ajax.googleapis.com/ajax/libs/angular_material/1.1.0-rc2/angular-material.min.js"></script>
      <script src="script.js"></script>
    
      <script src="raphael-2.1.4.min.js"></script>
      <script src="justgage.js"></script>
    
    </head>
    
    <body ng-app="YourApp" class="main_content">
    
      <div id="gauge" class="200x160px"></div>
    
      <div ng-controller="TestCtrl">
        <md-button class="md-raised">Hello</md-button>
      </div>
    
      <script>
        var g = new JustGage({
          id: "gauge",
          value: 67,
          min: 0,
          max: 100,
          title: "Visitors"
        });
      </script>
    
    </body>
    
    </html>
    

    Hope it helps.