1234567891011121314151617181920212223242526272829303132 |
- (function () {
- 'use strict';
- app.controller('Main', function($scope) {
- console.log("OK");
- console.log($scope);
- $scope.style = {
- width: 100,
- height: 100,
- background: "red",
- }
- $scope.x = 2;
- $scope.y = 3;
- $scope.color = 'red';
- $scope.data = ['apples', 'oranges', 'berries'];
- console.log($scope);
- $scope.sum = function() {
- $scope.result = $scope.x + $scope.y;
- console.log(this.x);
- }
- $scope.addItem = function() {
- $scope.data.push($scope.item);
- $scope.item = "";
- }
- $scope.deleteItem = function(index) {
- $scope.data.splice(index, 1);
- }
- });
- })();
|