var angular = require('angular');
require('../modules');
require('../services/InfoReleaseService');
'use strict';

var module = angular.module('info');

module.controller('InfoDetailOfficeCtrl', function($scope, $stateParams, $state,
    InfoReleaseService) {
	var pid = $stateParams.pid;
    $scope.id = $stateParams.id;
    $scope.flag = pid.indexOf('fawen') != -1 ? 'fawen' : 'shouwen';//用于页面区分

	$scope.title = $stateParams.modelName;

	(function(){
      init();
	})();

    function init() {
      InfoReleaseService.getInfoByInfoId(pid, $scope.id).then(function(data) {
        $scope.content = data.content;
        $scope.creTime = data.creTime? data.creTime.substring(0, 10) : '';
        $scope.subject = data.title;
        $scope.dept = data.dept;
        $scope.fileCode = data.fileCode;
        $scope.needGrade = data.needGrade;
      });
    }
});

