Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I make it work angularjs? i want to generate tree structure of organization using ng-repeat. #72

Open
Anjan-Inspheris opened this issue Jan 8, 2016 · 2 comments

Comments

@Anjan-Inspheris
Copy link

No description provided.

@karjac14
Copy link

karjac14 commented May 2, 2016

This solved angular ng-repeat issue, by adding $timeout (wihthout second argument of ms), this allows angular to complie

angular.module('myApp')
  .directive('myDirective', function($timeout) {
    return {
      restrict: 'A',
      link: function postLink(scope, element, attrs) {
        $timeout(function() {
          $(element).jOrgChart((scope.$eval(attrs.goalChart)));
        });
      }
    };
  });
<div id="chart-body" class="modal-body">
    <ul my-directive="{chartElement : '#chart-body'}" style="display:none">
      <li>
        <h5>{{parent.title}}</h5>
        <p> Status: {{parent.status_title}} </p>
        <p> Date Due: {{parent.Due_dt | date}} </p>
        <ul>
          <li>
            <h5>{{this.title}}</h5>
            <p> Status: {{this.goalstatus_title}} </p>
            <p> Date Due: {{this.Due_dt | date}} </p>
          </li>
          <li ng-repeat="sibling in siblings">
            <h5>{{sibling.title}}</h5>
            <p> Status: {{sibling.goalstatus_title}} </p>
            <p> Date Due: {{sibling.Due_dt | date}} </p>
          </li>
      </li>
    </ul>
  </div>

@dabeng
Copy link

dabeng commented May 8, 2016

Hi @Anjan-Inspheris @karjac14 .I just suggest a compromise -- encapsulating OrgChart plugin with angularjs directive and then apply it to your angular project. In fact, I don't think it make sense that building a new and powerful orgchart component with anguarjs from the scratch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants