Skip to content
New issue

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

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

Already on GitHub? # to your account

Move template string in directive to html file (enhancement) #43

Open
nvernooy opened this issue Apr 29, 2015 · 0 comments
Open

Move template string in directive to html file (enhancement) #43

nvernooy opened this issue Apr 29, 2015 · 0 comments

Comments

@nvernooy
Copy link

Is it possible to move the template string used in the directive for the treeview to an external html file?
I'm trying to do this myself but running into some trouble. So far I've moved the attrs variables to scope and my html looks like this:

<ul>
    <li data-ng-repeat="node in treeModel">
        <i class="collapsed"
            data-ng-show="node.nodeChildren.length && node.collapsed"
            data-ng-click="selectNodeHead(node)">
        </i>
        <i class="expanded"
            data-ng-show="node.nodeChildren.length && !node.collapsed"
            data-ng-click="selectNodeHead(node)">
        </i>
        <i class="normal"
            data-ng-hide="node.nodeChildren.length">
        </i>
        <span class="treenode node.nodeType"
            id="node.nodeId"
            data-ng-class="node.selected"
            data-ng-click="selectNodeLabel(node)">
            {{node.nodeLabel}}
        </span>
        <div data-ng-hide="!node.collapsed"
            data-tree-model="node.nodeChildren"
            data-node-id="nodeId"
            data-node-label="nodeLabel"
            data-node-children="nodeChildren"
        </div>
    </li>
</ul>

I had to take the treeId out, and the treeModel is being treated as string, I'm not sure why. Any help or comments would be appreciated.

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

No branches or pull requests

1 participant