is it possible to pass static HTML markup content to kendo angular modal window via k-content?

房东的猫 提交于 2019-12-11 09:44:20

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!