javascript - View template compilation in Angular JS -
i writing frontend app in angularjs. using lot of custom directives include templates, f.ex.
<body> <my-header></my-header> <site-information></site-information> </body>
defined in angular app:
var app = angular.module('myapp'); app.directive('myheader', function() { return { 'restrict': 'e', 'templateurl': '/partials/template.html' } });
and on.
however, useful me, if template include 2 different parts, or "sub-templates", without doing 2 more ajax-requests. in other words, template "compiled" before being shown.
<!-- template.html --> <div class="row"> <div class="col-md-6"> {{ content_one }} </div> </div> <div class="row"> <div class="col-md-6"> {{ content_two }} </div> </div>
is there easy way achieve this?
regards, skovmand.
Comments
Post a Comment