how do I define Firebase properly so jshint stops beeping.
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 = '';
};
});
You can also do the following in your jshint.rc
"jshint_options":
{
"predef": {
"Firebase": false
}
}
Since Firebase
is supposed to be added to the global object (window), you can use the $window
service:
.controller('MainCtrl', function ($firebase, $scope, $window) {
var pageRef = new $window.Firebase('...');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With