just started playing with Angular. I have several modal. same structure 
with header and footer. And the main part is a tree. I have data for three 
different tree.

I am using angular ui <http://angular-ui.github.io/bootstrap/>. and abn 
tree<https://github.com/nickperkinslondon/angular-bootstrap-nav-tree>

<script type="text/ng-template" id="my-template.html">
        <div class="modal-header">
            <h3 class="modal-title">Select your option</h3>
        </div>
        <div class="modal-body">
            <abn-tree tree-data="{{treeData}}"                          
                      icon-leaf="glyphicon glyphicon-stats"
                      on-select="treeClickHandler(branch)"
                      expand-level="1"
                      initial-selection="Select Subject">
            </abn-tree>        
        </div>            
    </script>

in my html. i have multiple places where i use this

<my-modal data-treeDataSource="tree1"></my-modal><my-modal 
data-treeDataSource="tree2"></my-modal><my-modal 
data-treeDataSource="tree3"></my-modal>

in my app.js

app = angular.module('myApp', deps).directive('myModal', function() {
  return {
    restrict: 'E',      
    templateUrl: 'my-template.html'
  };});;

app.controller('myController', function($scope) {


    //set treeData for the first modal and second modal, etc.  
    Sscope.tree1 = tree1Data1;
    Sscope.tree2 = tree1Data2;
    Sscope.tree3 = tree1Data3;


});

In my controller, i just want to set the tree data. I need three modal with 
different tree data source. My questions are

   1. What is the best way to differentiate different directives. by data 
   attribute or id or antything else
   2. What is the best way to set "tree-data" in my model (I dont have 
   actual data at the time of directive binding, i guess). I have the data 
   inside the controller.

Appreciate your time tor read the question.

-- 
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