(function () { 'use strict'; angular.module('app') .controller('SPLKCtrl', ['$scope', 'SPLK','$http', function ($scope, SPLK,$http) { $scope.remove = function (scope) { scope.remove(); }; $scope.toggle = function (scope) { scope.toggle(); }; $scope.newSubItem = function (scope) { var nodeData = scope.$modelValue; nodeData.nodes.push({ id: nodeData.id * 10 + nodeData.nodes.length, title: nodeData.title + '.' + (nodeData.nodes.length + 1), nodes: [] }); }; $scope.hh = []; $http({ method: 'GET', url: Gaddress + 'app/css/json1.json' }).success(function (data) { $scope.hh = data; $scope.Guo = "国抽数据" + data[0].nodes.length + "大类"; $scope.Shi = "市抽数据" + data[1].nodes.length + "大类"; }) $scope.tree2 = [ { 'id': 1, 'title': 'tree2 - item1', 'nodes': [] }, { 'id': 2, 'title': 'tree2 - item2', 'nodes': [] }, { 'id': 3, 'title': 'tree2 - item3', 'nodes': [] }, { 'id': 4, 'title': 'tree2 - item4', 'nodes': [] }]; }]); }());