(function () { 'use strict'; angular.module('app') .controller('JCXMCtrl', ['$scope', 'SPLK', '$http', function ($scope, SPLK, $http) { $scope.remove = function (scope) { scope.remove(); }; $scope.toggle = function (scope) { alert("asd"); 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/jcxm.json' }).success(function (data) { $scope.hh = data; $scope.mytt = "检测项目数据" + data.length; alert($scope.mytt); }) $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': [] }]; }]); }());