I'm having some difficulting creating a custom directive to create a modal 
and I was wondering if someone could point me in the right direction.  I 
hope thf 

app.directive('zhu-li', function() {
  return {
    restrict: 'E',
    require: ['^thing-type','^thing-id'],
    controller: function($scope, ngDialog, $element) {
      var scope = this;
      scope.thing = {};


      activate();


      function activate() {
        ThingService.getThing(scope.thingType, scope.thingId)
          .then(function (data) {
            scope.thing = data;
          });
      };


      scope.doTheThing = function () {
        scope.thing = scope.thing;
        ngDialog.open({
          template: 'thing-modal.html',
          scope: $scope,
          overlay: false
        });
      };
    },
    scope: {
      thingType : '=thing-type',
      thingId : '=thing-id'
        },
    template: '<a ng-click="doTheThing()">Do the thing</a>'
  };
});


<div ng-controller="OtherController">
  <zhu-li thing-id="{{thingId}}" thing-type="{{thingType}}"></zhu-li>
</div>


-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to