AngularJs&安培; Laravel [英] AngularJs & Laravel

查看:181
本文介绍了AngularJs&安培; Laravel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道AngularJs是前端和Laravel是后端,但我的问题是

i know that AngularJs is FrontEnd and Laravel is Backend but my questions is

为什么我需要在我需要的一切是通过Laravel完成的第一个地方使用AngularJs?

why do i need to use AngularJs in the first place where everything i need is done through Laravel ?

这是我的理解是,我可以让应用程序有两种LANGS JS PHP ,但我发现很多用户同时使用这对我来说是一个初学者它似乎是一种矫枉过正,所以可能有人请在答案最简单的可能形式,

from what i understood is that i can make an app with either langs JS or PHP ,but i find lots of users use both which for me as a beginner it seems like an overkill , so could someone please explain in the simplest possible form of an answer ,

什么是在同一个项目中同时使用的好处?
如何做u通常构建你的应用程序/文件夹当u同时使用专门两者都是MVC?

what is the benefit of using both in the same project ? and how do u usually structure your app/folders when u use both specially that both are MVC ?

推荐答案

我怀疑问题可能与计算器的质量方针相抵触,你几乎可以得到更好的问两个独立的问题。即。

I suspect the question may conflict with stackoverflow's quality guidelines and you may almost be better asking two separate questions. i.e.


  1. 当/为什么要学习/在WEP项目中使用的角

  2. 如何设置文件夹结构

有关设置文件夹结构,看看这些资源

For setting up the folder structure, check out these resources

<一个href=\"http://scotch.io/tutorials/php/create-a-laravel-and-angular-single-page-comment-application\">http://scotch.io/tutorials/php/create-a-laravel-and-angular-single-page-comment-application
<一href=\"https://www.youtube.com/watch?v=hqAyiqUs93c\">https://www.youtube.com/watch?v=hqAyiqUs93c

我真的只能说,为​​什么我用angularjs laravel,你是正确的,你可以使用laravel无角,但我之所以用角以及laravel是因为有一些事情,JavaScript的只是更好地为比服务器端的应用程式如

I can only really speak to why I use laravel with angularjs and you are right that you can use laravel without angular, but the reason I use angular as well as laravel is because there are some things that javascript is just better positioned for than server side apps e.g.


  • 使用AJAX和没有每当你要检查/过程中的一些小东西,像成形式是否有效电子邮件地址是否用户键入重新加载页面。

  • 更快的,因为当你阿贾克斯回服务器,你没有加载整个页面,只需要这件。

  • 您可以立即给予反馈给用户 - 例如当他们填写表格 - 你可以检查其输入验证并立即给他们的反馈。
    随着lavavel您必须执行一个往返回服务器,并可能返回错误信息的集合。

因此​​,如果你希望你的网站/ web应用程序有那些你需要写在JavaScript功能的好处。
我不能说我用所有的框架,那么说这个角度是最好的,但对我的角度提供了一个综合解决方案套件以及范围广泛的问题上的顶部架构,似乎运作良好。

So if you want your website/webapp to have those benefits you need to write the functionality in javascript. I can't say I have used all the frameworks to then say that angular is the best one, but for me angular provides an integrated suite of solutions and to a wide range of issues, on top of an architecture that seems to work well.

我想这是为什么有相当一些新的概念学习,需要对这些部件不会立即明显。结果
这可能是由于这样的事实,正在使用的组件来执行一些功能,例如使用$范围对象中继控制器和视图之间的数据,还提供了更大的画面,例如功能维护视图和控制器之间的分离 - 这与组织code,可测性以及其他因素的帮助。

I think this is partly why there are quite a few new concepts to learn and the need for these components is not immediately obvious.
This may be due to the fact that a component you are using to perform some function, e.g. using a $scope object to relay data between a controller and a view, also serves a function in the bigger picture, e.g. maintaining separation between the view and the controller - which helps with organising code, testability as well as other factors.

如果您使用的角度以及Laravel(而不是仅仅通过自身Laravel),那么你将有给你的用户这些好处的选项,因为你有更多的可用选项如使用laravel它最适合您的应用程序和用户或使用角度它给出最佳结果的要求 - 你将不得不在最后一个更好的Web应用程序

If you use angular as well as Laravel (as opposed to just Laravel by itself) you will then have the option of giving your users these benefits, because you have more options available e.g. use laravel where it best suits the requirements of your app and users or use angular where it gives the best result - and you will have a better web app in the end.

这篇关于AngularJs&安培; Laravel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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