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

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.

主站蜘蛛池模板: 文山县| 运城市| 镇赉县| 绥中县| 洮南市| 景谷| 通城县| 福海县| 旬邑县| 九台市| 绥江县| 黎城县| 灵川县| 安多县| 南郑县| 辽源市| 曲阳县| 梧州市| 陇南市| 靖州| 达拉特旗| 浮梁县| 新丰县| 基隆市| 务川| 肇东市| 兖州市| 固原市| 广西| 祥云县| 民勤县| 平利县| 桦南县| 体育| 宁武县| 平陆县| 拉萨市| 衡山县| 本溪市| 酉阳| 长顺县|