加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

angularjs – jsHint投掷’Firebase’未定义警告

发布时间:2020-12-17 09:03:16 所属栏目:安全 来源:网络整理
导读:参见英文答案 How to tell JSLint / JSHint what global variables are already defined3个 如何正确定义Firebase,以便jshint停止发出哔哔声. 我的代码正在运行……只是jshint很烦人 app.js angular .module('morningharwoodApp',[ 'firebase','ngAnimate','
参见英文答案 > How to tell JSLint / JSHint what global variables are already defined3个
如何正确定义Firebase,以便jshint停止发出哔哔声.

我的代码正在运行……只是jshint很烦人

app.js

angular
  .module('morningharwoodApp',[
    'firebase','ngAnimate','ngCookies','ngResource','ngRoute','ngSanitize','ngTouch'

  ])

main.js

angular.module('morningharwoodApp')
  .controller('MainCtrl',function ($scope,$firebase) {
    // var Firebase;
    var pageRef = new Firebase('https://morningharwood.firebaseIO.com/page');
    // var pageRef = new Firebase('https://morningharwood.firebaseIO.com/page');


    //init
    $scope.pages = $firebase(pageRef);
    $scope.newPage = {
        title: '',slug: '',url: '',desc: '',active: false,template: [
            {
                type: ''
            }
        ],img: '',dateCreated: '',dateUpdated: ''

    };

    //CRUD

    //add
    $scope.addPage = function() {
        $scope.pages.$add($scope.newPage);
        $scope.newPage = '';
    };
  });
您还可以在jshint.rc中执行以下操作
"jshint_options":
    {
        "predef": {
            "Firebase": false
        }
     }

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读