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

/**
 * 信息发布Detail页面 缓存服务
 */
var module = angular.module('notice.directives');

module.directive('sinoNoticeNetwork', function($state, $rootScope) {
  return {
    restrict: 'E',
    templateUrl: 'views/notice/sinoNoticeNetwork.tpl.html',
    link: function(scope, element, attrs) {
      scope.title = attrs.networkTitle || '当前网络不可用，请检查你的网络设置。';
      scope.$watch(function() {
        scope.netWorkStatus = $rootScope.netWorkStatus;
      });

      /**
       * 查看如何设置网络
       */
      scope.goToNetworkSetting = function() {
        $state.go('notice-network');
      };

    }
  };
});
