Merge "Add spec cpu2006 test case"
[yardstick.git] / gui / app / scripts / controllers / suitedetail.controller.js
1 'use strict';
2
3 angular.module('yardStickGui2App')
4     .controller('suiteDetailController', ['$scope', '$state', '$stateParams', 'mainFactory', 'Upload', 'toaster',
5         function($scope, $state, $stateParams, mainFactory, Upload, toaster) {
6
7
8             init();
9
10
11             function init() {
12
13                 getSuiteDetail();
14
15             }
16
17             function getSuiteDetail() {
18                 mainFactory.suiteDetail().get({
19                     'suiteName': $stateParams.name
20
21                 }).$promise.then(function(response) {
22                     if (response.status == 1) {
23                         $scope.suiteinfo = response.result.testsuite;
24
25                     }
26                 }, function(error) {
27                     toaster.pop({
28                         type: 'error',
29                         title: 'fail',
30                         body: 'unknow error',
31                         timeout: 3000
32                     });
33                 })
34             }
35             $scope.goBack = function goBack() {
36                 window.history.back();
37             }
38
39
40
41
42
43
44
45
46
47         }
48     ]);