问题
If I have this in my controller:
$scope.windowContent = not sure what to put here;
and my window's markup is this:
<div kendo-window="win2" k-title="'AJAX content'"
k-width="600" k-height="200" k-visible="false"
k-content= ?????????????
k-on-open="win2visible = true" k-on-close="win2visible = false"></div>
</div>
Is it possible to specify an angular expression {{windowContent}} as the value for k-content
? I am trying to pass HTML markup here to the window, rather than fetch it from a URL.
回答1:
Yes, it is possible.
You just have to specify it as content as you have attempted, but also pass in the template
property :
<div kendo-window="win2" k-title="'AJAX content'"
k-width="600" k-height="200" k-visible="false"
k-content= "{template : windowContent}"
k-on-open="win2visible = true" k-on-close="win2visible = false">
</div>
That being said, you might feel like the angular-kendo documentation is very sparse, but once you get the idea of directives, you can also see the API documentation for plenty of other options. For example, this link contains the window widget documentation completely :
http://docs.telerik.com/kendo-ui/api/javascript/ui/window#configuration-content.template
Hope this helps!
来源:https://stackoverflow.com/questions/26288918/is-it-possible-to-pass-static-html-markup-content-to-kendo-angular-modal-window