官术网_书友最值得收藏!

Controllers

Controllers are part of the framework to handle the business logic of the application. They should be used to control the flow of data in an application. The controller is attached to the DOM via the ng-controller directive.

To add some actions to our view, we need to create functions on controllers, the way to do this is by creating functions and adding them to the $scope object.

The controllers cannot be used to carry out DOM manipulations, format data and filter data, it is considered best practice in the AngularJS world.

Usually, the controllers inject the service objects to delegate handling the business logic. We will understand services in the next section.

主站蜘蛛池模板: 西峡县| 张家港市| 辛集市| 明溪县| 老河口市| 九龙坡区| 贵港市| 临桂县| 双峰县| 诸城市| 淄博市| 莱芜市| 宁国市| 霸州市| 新竹市| 滁州市| 乳山市| 福贡县| 台州市| 乐昌市| 喀什市| 马尔康县| 南召县| 靖西县| 福贡县| 论坛| 龙游县| 上饶市| 石城县| 河西区| 门头沟区| 宜兴市| 资兴市| 桑日县| 宜黄县| 穆棱市| 莱阳市| 虞城县| 浙江省| 花莲市| 兴安县|