简体   繁体   中英

Is it possible to use only the AngularJS's front-end scripts?

I have seen people talking about using a back-end language (like asp.net, php) with AngularJS. But, they are just making HTTP request from NodeJs to the other backend language by creating an API. AngularJS or NodeJs is already a back-end language itself I don't see myself developing 2 back-end web applications just to use AngularJS.

Is it possible to get only the AngularJS's generated front-end scripts to run on a web project using another back-end language or just a simple project without back-end (Html with JavaScript version 6) Or use AngularJS like if it was ViewJs?

The thing is just I want to use ng-if , ng-for ... like in view we use v-if , v-for ... and omit the Angularjs routing and other NodeJs stuff. So that, when I run the project I don't need to run NodeJs or Angular-cli. I mean just using the AngularJS template.

I hope I and my English were clear.

AngularJS is self-compiling in the browser. No need for NodeJS or any backend compilation.

 <script src="//unpkg.com/angular/angular.js"></script> <body ng-app> <input type="checkbox" ng-model="showMessage">ng-if = {{showMessage}}<br> <p ng-if="showMessage"> See, no backend necessary. Ng-if was compiled in the browser. </p> </body> 


On angularjs.org they say "This site and all of its contents are referring to AngularJS (version 1.x), if you are looking for the latest Angular, please visit angular.io .". So, what does that mean?

Here is a friendly reminder: 1

Angular 1.x  == AngularJS
Angular 2+   == Angular

For more information, see

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