mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 16:13:24 +02:00
Fix all res/ files with ESLint rules with 0 errors.
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
module.exports = function ($http, $templateCache, $compile) {
|
||||
module.exports = function($http, $templateCache, $compile) {
|
||||
var cache = {}
|
||||
|
||||
return function (src, scope, cloneAttachFn) {
|
||||
return function(src, scope, cloneAttachFn) {
|
||||
var compileFn = cache[src]
|
||||
if (compileFn) {
|
||||
compileFn(scope, cloneAttachFn)
|
||||
} else {
|
||||
$http.get(src, { cache: $templateCache }).success(function (response) {
|
||||
$http.get(src, {cache: $templateCache}).success(function(response) {
|
||||
var responseContents = angular.element('<div></div>').html(response).contents()
|
||||
compileFn = cache[src] = $compile(responseContents)
|
||||
compileFn(scope, cloneAttachFn)
|
||||
|
||||
@@ -2,13 +2,13 @@ module.exports = function includeCachedDirective(CompileCacheService) {
|
||||
return {
|
||||
restrict: 'ECA',
|
||||
terminal: true,
|
||||
compile: function (element, attrs) {
|
||||
compile: function(element, attrs) {
|
||||
var srcExp = attrs.ngIncludeCached || attrs.src
|
||||
|
||||
return function (scope, element) {
|
||||
return function(scope, element) {
|
||||
var src = scope.$eval(srcExp)
|
||||
var newScope = scope.$new()
|
||||
CompileCacheService(src, newScope, function (compiledElm) {
|
||||
CompileCacheService(src, newScope, function(compiledElm) {
|
||||
element.append(compiledElm)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
describe('includeCached', function () {
|
||||
describe('includeCached', function() {
|
||||
|
||||
beforeEach(angular.mock.module(require('./').name));
|
||||
beforeEach(angular.mock.module(require('./').name))
|
||||
|
||||
var scope, compile;
|
||||
var scope, compile
|
||||
|
||||
beforeEach(inject(function ($rootScope, $compile) {
|
||||
scope = $rootScope.$new();
|
||||
compile = $compile;
|
||||
}));
|
||||
beforeEach(inject(function($rootScope, $compile) {
|
||||
scope = $rootScope.$new()
|
||||
compile = $compile
|
||||
}))
|
||||
|
||||
it('should ...', function () {
|
||||
it('should ...', function() {
|
||||
|
||||
/*
|
||||
To test your directive, you need to create some html that would use your directive,
|
||||
@@ -19,5 +19,5 @@ describe('includeCached', function () {
|
||||
expect(element.text()).toBe('hello, world');
|
||||
*/
|
||||
|
||||
});
|
||||
});
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user