12345678910111213141516171819202122232425262728293031323334353637383940 |
- (function() {
- 'use strict';
- app.controller('Main', function($scope){
- console.log('ok')
- $scope.x = 1;
- $scope.x = 2;
- $scope.color = 'red';
- $scope.data = ['apple','oranges', 'banana'];
- $scope.sum = function() {
- $scope.result = $scope.x + $scope.y
- };
- $scope.addItem = function() {
- $scope.data.push($scope.item);
- $scope.item = '';
- };
- $scope.deleteItem = function(item){
- $scope.data.splice(item, 1);
- };
- $scope.style = {
- width: 100,
- height: 100,
- background: "red",
- display: "inline-block"
- };
- $scope.changeWidth = function() {
- $scope.style.width = $scope.width;
- };
- $scope.changeHeight = function() {
- $scope.style.height = $scope.height;
- };
- $scope.changeColor = function() {
- $scope.style.background = $scope.background;
- };
- })
- })();
|