Merge "Remove redundancy file and do relative modification"
[yardstick.git] / gui / app / scripts / controllers / testcasedetail.controller.js
1 'use strict';
2
3 angular.module('yardStickGui2App')
4     .controller('testcaseDetailController', ['$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                 getTestcaseDetail();
14
15
16             }
17
18             function getTestcaseDetail() {
19                 mainFactory.getTestcaseDetail().get({
20                     'testcasename': $stateParams.name
21
22                 }).$promise.then(function(response) {
23                     if (response.status == 1) {
24                         $scope.testcaseInfo = response.result.testcase;
25
26                     }
27                 }, function(error) {
28                     toaster.pop({
29                         type: 'error',
30                         title: 'fail',
31                         body: 'unknow error',
32                         timeout: 3000
33                     });
34                 })
35             }
36
37             $scope.goBack = function goBack() {
38                 window.history.back();
39             }
40
41
42
43
44
45
46
47
48
49         }
50     ]);