我可以使用EJS与角的js? [英] can i use EJS with Angular js?

查看:114
本文介绍了我可以使用EJS与角的js?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我是新来的js角。我已经使用jQuery和jQuery UI运行伟大的Web应用程序。结果
现在我想完全摆脱的jQuery和打算迁移到,因为它的MVC(MVW)模式Angualarjs。

Hi i am new to Angular Js. I have great web app already running with JQuery and jQuery UI.
Now i want to completely get rid of Jquery and am going to migrate to Angualarjs because of its MVC (MVW) pattern.

所以我的jQuery的应用程序与运行EJS模板和完全DOM操作。但是,当我想到角JS,我有疑虑。我仍然可以使用EJS或没有?结果
所以,请指导我,我是否可以使用与否。

So my jquery application is running with EJS for templates and entirely DOM manipulation. But when I think about Angular js, i have doubts. Can I still use EJS or not?
So pls guide me whether I can use or not.

另一个疑问是,让我们假设我有列表页面。它是动态更新的,它会显示10条记录首页然后根据用户的滚动,接下来的10条记录将在AJAX后DOM追加。我们可以追加到DOM使用动态角度?

Another doubt is, lets assume I have list page. It is updated dynamically, and it will display 10 records first then based on user scroll, the next 10 records will be appended in the DOM after AJAX. Can we append to the DOM dynamically using Angular?

如何在角达到这类事情?

How do I achieve these kind of things in Angular?

推荐答案

您可以结合使用EJS(服务器或客户端)有角,但没有必要,你可能会过于复杂的事情。 AngularJS很能干在关注的一种方式非常的分离本身操纵DOM。有角的工作最优雅的方式是有一个的 REST风格的的后端,只是从一个网络服务器服务于一些静态的HTML / JS文件。

You can use EJS (server or client side) in combination with Angular but there's no need and you'll probably overcomplicate things. AngularJS is very capable for manipulating the DOM by itself in a very separation of concerns kind of way. The most elegant way to work with Angular is to have a RESTful backend and just serve some static html/js files from a webserver.

至于无尽的滚动,有<一个href=\"https://www.google.nl/search?q=endless+scrolling+angularjs&oq=endless+scrolling+angularjs\">tons即用插件(模块)可供选择,也可以自己编写。基本上,这将需要一个 NG重复directive 显示当前加载的项目和指令,会通知控制器/范围来当用户向下滚动装载更多的物品。
一个好的简单的文章,可以发现 href=\"https://$c$crwall.com/p/cl7zyg\">。

As for endless scrolling, there are tons of ready to use plugins (modules) to choose from or you can write your own. Basically this will need a view with a ng-repeat directive to display the currently loaded items and a directive that will notify a controller/scope to load more items when the user is scrolling down. A nice simple article can be found here.

类似的问题:

  • Mixing angular and asp.net mvc webapi
  • Actual use of jade template and angularjs

这篇关于我可以使用EJS与角的js?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆