The question about angular

recently in learning angular, it should be said that angular2, because he learned vue, before coming into contact with angular, always compares the relationship between the two in the learning process, contrasts with each other to learn and use, using two frameworks to achieve some small demo, for example, todomvc .
but I was confused when I learned about the service. How should I understand the service of angular, that is, service?
I am learning the channel of anguar, that is, pipe. What I am comparing is that the instructions of vue"s filter,angular are similar to those of vue, but the configuration is rather strange. I can only describe it this way. I have no idea what the nature of angular"s configuration of some services is.
can"t find a reference in vue at all.
Xiaobai, don"t spray, Wanwang God will solve the confusion


The service in

AngularJS actually provides a way to extract common class libraries, such as some utility class methods. Our traditional practice is to write a utility class, populate the relevant tool methods into utility, and finally put the utility class into a global variable, so that utility methods can be called anywhere. If you use AngularJS's service, you create a utility service according to his rules, and then you can invoke methods in utility anywhere through dependency injection. There are three ways for Angular to create services: providers,factory,service,. You can see the difference between provider, factory and service in AngularJS

author: Xu Haifeng
link:

service is an encapsulation of the model layer, and the extraction of common class libraries is usually used to manage data and requests.


is mainly to facilitate the management of services (classes). You can learn about the service, of IOC (dependency injection)


angular.
one is that injectable service, is decorated with @ Injectable, which uses the
idea of dependency injection. You can inject other service, into component, such as passing values to each other as a bridge between two component, or as an application-level service, such as authentication, dirty check, and so on.
the other is non-injectable service, that is, it is not decorated with @ Injectable.
then its function is very simple, that is, it is an auxiliary class.


you can uniformly manage data requests in service

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e58626-454a4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e58626-454a4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?