简体   繁体   中英

Angular js is front end or backend?

我只是想知道 Angular js 是前端语言还是后端语言。因为有时有时会像后端一样......我们应该使用 angular 作为前端,使用 php 作为后端而不是节点 js 吗???

Angularjs is a front-end framework powered by JavaScript. Even you have said that in your introduction.

From the docs,

Why AngularJS?

HTML is great for declaring static documents, but it falters when we try to use it for declaring dynamic views in web-applications. AngularJS lets you extend HTML vocabulary for your application. The resulting environment is extraordinarily expressive, readable, and quick to develop.

Other frameworks deal with HTML's shortcomings by either abstracting away HTML, CSS, and/or JavaScript or by providing an imperative way for manipulating the DOM. Neither of these address the root problem that HTML was not designed for dynamic views.

AngularJS is a toolset for building the framework most suited to your application development. It is fully extensible and works well with other libraries. Every feature can be modified or replaced to suit your unique development workflow and feature need.

I think it all boils down to what is a front-end technology, the part where the user will have most of the interactions with. And because these interactions are done with the help of the browser, and browsers mostly understand HTML, CSS and javascript.

So the creators of Angular made a framework that is based on typescript, which can generate HTML, CSS and javascript code with the help of transpilers, for the purpose of generating a workable package that can be understood by a browser.

That's why Angular is considered a frontend framework. Its capabilities do not include any of the features that you will find in a backend language.

Angular 4 is front-end framework Powered by Google, it helps a lot in making fastest single page application and works 100% perfect.

Your question is that, Can we use PHP as Back-end?

The answer is simple.Yes, with the help of HTTP service and using PHP API. You can make a database on MYSQL and built logic using PHP and this can be easily accessed on Angular 2/4 app with the help of Service HTTP request. Either you using PHP frameworks like Laravel or Codeignitor then this will also work too.

AngularJs or Angular2+ (a complete new writeup of the AngularJS) they are created for building a complete user interfaces for the application users.

Sorry you can't use Angular2+ or Angular JS for the backend as a framework !

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM