javascript - Nested view templates in Angular.js? -
i have in html file part of html code, repeats multiple times ( have multiple tables in html file...)
<table> <thead> <tr> <th data-field="id">vorname</th> <th data-field="name">nachname</th> <th data-field="price">anzahlaktien</th> <th data-field="action">wert</th> <th data-field="action">einkaufsdatum</th> <th data-field="action">ort</th> <th data-field="action">aktion</th> </tr> </thead> <tbody> // different data
is possible set "partial view" in angular.js? (like in meteor.js) can include needed wit {{myview}}...
you can use ng-include
to include html partial file. btw there many ways , using directive own templateurl
(i think) best approach.
<div ng-include="'partial.html'"></div>
html:
<my-directive></my-directive>
js:
.directive('mydirective', function() { return { templateurl: 'partial.html' }; });
Comments
Post a Comment