Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.min.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body ng-app="app">
  
<rating max-stars="5" url="url.json"></rating>
</body>
</html>
 
var app = angular.module('app', []);
app.controller('ratingController', 
  function ($scope, $element, $attrs) {
  console.log('ctrl.scope', $scope.url);
  console.log('ctrl.attrs', $attrs.url);
});
      
app.directive('rating', function () {
  return {
    restrict: 'E',
    scope: {
      maxStars: '=',
      url: '@'
    },
    controller: 'ratingController',
    link: function (scope, el, attrs) {
      console.log('dir.scope', scope.url);
      console.log('dir.attrs', attrs.url);
    }
  };   
});
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers