style: remove ws and enfore no-trailing-ws jscs rule
This commit is contained in:
+2
-1
@@ -1,3 +1,4 @@
|
||||
{
|
||||
"disallowKeywords": ["with"]
|
||||
"disallowKeywords": ["with"],
|
||||
"disallowTrailingWhitespace": true
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
"disallowImplicitTypeConversion": ["string"],
|
||||
"disallowMultipleLineBreaks": true,
|
||||
"disallowKeywordsOnNewLine": ["else"],
|
||||
"disallowTrailingWhitespace": true,
|
||||
"requireLineFeedAtFileEnd": true,
|
||||
"validateJSDoc": {
|
||||
"checkParamNames": true,
|
||||
|
||||
+2
-2
@@ -92,13 +92,13 @@
|
||||
* @name ng
|
||||
* @module ng
|
||||
* @description
|
||||
*
|
||||
*
|
||||
* # ng (core module)
|
||||
* The ng module is loaded by default when an AngularJS application is started. The module itself
|
||||
* contains the essential components for an AngularJS application to function. The table below
|
||||
* lists a high level breakdown of each of the services/factories, filters, directives and testing
|
||||
* components available within this core module.
|
||||
*
|
||||
*
|
||||
* <div doc-module-components="ng"></div>
|
||||
*/
|
||||
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
/* global
|
||||
angularModule: true,
|
||||
version: true,
|
||||
|
||||
|
||||
$LocaleProvider,
|
||||
$CompileProvider,
|
||||
|
||||
|
||||
htmlAnchorDirective,
|
||||
inputDirective,
|
||||
inputDirective,
|
||||
|
||||
@@ -350,7 +350,7 @@ function annotate(fn) {
|
||||
*
|
||||
* - `Object`: then it should have a `$get` method. The `$get` method will be invoked using
|
||||
* {@link auto.$injector#invoke $injector.invoke()} when an instance needs to be created.
|
||||
* - `Constructor`: a new instance of the provider will be created using
|
||||
* - `Constructor`: a new instance of the provider will be created using
|
||||
* {@link auto.$injector#instantiate $injector.instantiate()}, then treated as `object`.
|
||||
*
|
||||
* @returns {Object} registered provider instance
|
||||
@@ -478,9 +478,9 @@ function annotate(fn) {
|
||||
* var Ping = function($http) {
|
||||
* this.$http = $http;
|
||||
* };
|
||||
*
|
||||
*
|
||||
* Ping.$inject = ['$http'];
|
||||
*
|
||||
*
|
||||
* Ping.prototype.send = function() {
|
||||
* return this.$http.get('/ping');
|
||||
* };
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*
|
||||
* It also watches the `$location.hash()` and scrolls whenever it changes to match any anchor.
|
||||
* This can be disabled by calling `$anchorScrollProvider.disableAutoScrolling()`.
|
||||
*
|
||||
*
|
||||
* @example
|
||||
<example>
|
||||
<file name="index.html">
|
||||
@@ -30,7 +30,7 @@
|
||||
// set the location.hash to the id of
|
||||
// the element you wish to scroll to.
|
||||
$location.hash('bottom');
|
||||
|
||||
|
||||
// call $anchorScroll()
|
||||
$anchorScroll();
|
||||
};
|
||||
|
||||
+2
-2
@@ -17,7 +17,7 @@ var $animateMinErr = minErr('$animate');
|
||||
*/
|
||||
var $AnimateProvider = ['$provide', function($provide) {
|
||||
|
||||
|
||||
|
||||
this.$$selectors = {};
|
||||
|
||||
|
||||
@@ -153,7 +153,7 @@ var $AnimateProvider = ['$provide', function($provide) {
|
||||
* @description Moves the position of the provided element within the DOM to be placed
|
||||
* either after the `after` element or inside of the `parent` element. Once complete, the
|
||||
* done() callback will be fired (if provided).
|
||||
*
|
||||
*
|
||||
* @param {jQuery/jqLite element} element the element which will be moved around within the
|
||||
* DOM
|
||||
* @param {jQuery/jqLite element} parent the parent element where the element will be
|
||||
|
||||
+11
-11
@@ -6,9 +6,9 @@
|
||||
*
|
||||
* @description
|
||||
* Factory that constructs cache objects and gives access to them.
|
||||
*
|
||||
*
|
||||
* ```js
|
||||
*
|
||||
*
|
||||
* var cache = $cacheFactory('cacheId');
|
||||
* expect($cacheFactory.get('cacheId')).toBe(cache);
|
||||
* expect($cacheFactory.get('noSuchCacheId')).not.toBeDefined();
|
||||
@@ -17,8 +17,8 @@
|
||||
* cache.put("another key", "another value");
|
||||
*
|
||||
* // We've specified no options on creation
|
||||
* expect(cache.info()).toEqual({id: 'cacheId', size: 2});
|
||||
*
|
||||
* expect(cache.info()).toEqual({id: 'cacheId', size: 2});
|
||||
*
|
||||
* ```
|
||||
*
|
||||
*
|
||||
@@ -199,7 +199,7 @@ function $CacheFactoryProvider() {
|
||||
* The first time a template is used, it is loaded in the template cache for quick retrieval. You
|
||||
* can load templates directly into the cache in a `script` tag, or by consuming the
|
||||
* `$templateCache` service directly.
|
||||
*
|
||||
*
|
||||
* Adding via the `script` tag:
|
||||
* ```html
|
||||
* <html ng-app>
|
||||
@@ -211,29 +211,29 @@ function $CacheFactoryProvider() {
|
||||
* ...
|
||||
* </html>
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* **Note:** the `script` tag containing the template does not need to be included in the `head` of
|
||||
* the document, but it must be below the `ng-app` definition.
|
||||
*
|
||||
*
|
||||
* Adding via the $templateCache service:
|
||||
*
|
||||
*
|
||||
* ```js
|
||||
* var myApp = angular.module('myApp', []);
|
||||
* myApp.run(function($templateCache) {
|
||||
* $templateCache.put('templateId.html', 'This is the content of the template');
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* To retrieve the template later, simply use it in your HTML:
|
||||
* ```html
|
||||
* <div ng-include=" 'templateId.html' "></div>
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* or get it via Javascript:
|
||||
* ```js
|
||||
* $templateCache.get('templateId.html')
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* See {@link ng.$cacheFactory $cacheFactory}.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -191,7 +191,7 @@
|
||||
</example>
|
||||
*
|
||||
* @element INPUT
|
||||
* @param {expression} ngDisabled If the {@link guide/expression expression} is truthy,
|
||||
* @param {expression} ngDisabled If the {@link guide/expression expression} is truthy,
|
||||
* then special attribute "disabled" will be set on the element
|
||||
*/
|
||||
|
||||
@@ -226,7 +226,7 @@
|
||||
</example>
|
||||
*
|
||||
* @element INPUT
|
||||
* @param {expression} ngChecked If the {@link guide/expression expression} is truthy,
|
||||
* @param {expression} ngChecked If the {@link guide/expression expression} is truthy,
|
||||
* then special attribute "checked" will be set on the element
|
||||
*/
|
||||
|
||||
@@ -261,7 +261,7 @@
|
||||
</example>
|
||||
*
|
||||
* @element INPUT
|
||||
* @param {expression} ngReadonly If the {@link guide/expression expression} is truthy,
|
||||
* @param {expression} ngReadonly If the {@link guide/expression expression} is truthy,
|
||||
* then special attribute "readonly" will be set on the element
|
||||
*/
|
||||
|
||||
@@ -280,7 +280,7 @@
|
||||
* The `ngSelected` directive solves this problem for the `selected` atttribute.
|
||||
* This complementary directive is not removed by the browser and so provides
|
||||
* a permanent reliable place to store the binding information.
|
||||
*
|
||||
*
|
||||
* @example
|
||||
<example>
|
||||
<file name="index.html">
|
||||
@@ -300,7 +300,7 @@
|
||||
</example>
|
||||
*
|
||||
* @element OPTION
|
||||
* @param {expression} ngSelected If the {@link guide/expression expression} is truthy,
|
||||
* @param {expression} ngSelected If the {@link guide/expression expression} is truthy,
|
||||
* then special attribute "selected" will be set on the element
|
||||
*/
|
||||
|
||||
@@ -336,7 +336,7 @@
|
||||
</example>
|
||||
*
|
||||
* @element DETAILS
|
||||
* @param {expression} ngOpen If the {@link guide/expression expression} is truthy,
|
||||
* @param {expression} ngOpen If the {@link guide/expression expression} is truthy,
|
||||
* then special attribute "open" will be set on the element
|
||||
*/
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ var nullFormCtrl = {
|
||||
* - `pattern`
|
||||
* - `required`
|
||||
* - `url`
|
||||
*
|
||||
*
|
||||
* @description
|
||||
* `FormController` keeps track of all its controls and nested forms as well as state of them,
|
||||
* such as being valid/invalid or dirty/pristine.
|
||||
|
||||
@@ -295,7 +295,7 @@ var inputType = {
|
||||
var text = element(by.binding('text'));
|
||||
var valid = element(by.binding('myForm.input.$valid'));
|
||||
var input = element(by.model('text'));
|
||||
|
||||
|
||||
it('should initialize to model', function() {
|
||||
expect(text.getText()).toContain('me@example.com');
|
||||
expect(valid.getText()).toContain('true');
|
||||
@@ -409,7 +409,7 @@ var inputType = {
|
||||
|
||||
expect(value1.getText()).toContain('true');
|
||||
expect(value2.getText()).toContain('YES');
|
||||
|
||||
|
||||
element(by.model('value1')).click();
|
||||
element(by.model('value2')).click();
|
||||
|
||||
@@ -1021,7 +1021,7 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$
|
||||
* You can override this for input directives whose concept of being empty is different to the
|
||||
* default. The `checkboxInputType` directive does this because in its case a value of `false`
|
||||
* implies empty.
|
||||
*
|
||||
*
|
||||
* @param {*} value Reference to check.
|
||||
* @returns {boolean} True if `value` is empty.
|
||||
*/
|
||||
|
||||
@@ -144,14 +144,14 @@ var ngBindTemplateDirective = ['$interpolate', function($interpolate) {
|
||||
*
|
||||
* @example
|
||||
Try it here: enter text in text box and watch the greeting change.
|
||||
|
||||
|
||||
<example module="ngBindHtmlExample" deps="angular-sanitize.js">
|
||||
<file name="index.html">
|
||||
<div ng-controller="ngBindHtmlCtrl">
|
||||
<p ng-bind-html="myHTML"></p>
|
||||
</div>
|
||||
</file>
|
||||
|
||||
|
||||
<file name="script.js">
|
||||
angular.module('ngBindHtmlExample', ['ngSanitize'])
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
* **Note:** Here is a list of values that ngShow will consider as a falsy value (case insensitive):<br />
|
||||
* "f" / "0" / "false" / "no" / "n" / "[]"
|
||||
* </div>
|
||||
*
|
||||
*
|
||||
* ## A note about animations with ngShow
|
||||
*
|
||||
* Animations in ngShow/ngHide work with the show and hide events that are triggered when the directive expression
|
||||
@@ -211,7 +211,7 @@ var ngShowDirective = ['$animate', function($animate) {
|
||||
* ```
|
||||
*
|
||||
* Just remember to include the important flag so the CSS override will function.
|
||||
*
|
||||
*
|
||||
* <div class="alert alert-warning">
|
||||
* **Note:** Here is a list of values that ngHide will consider as a falsy value (case insensitive):<br />
|
||||
* "f" / "0" / "false" / "no" / "n" / "[]"
|
||||
|
||||
@@ -64,7 +64,7 @@ var ngTranscludeDirective = ngDirective({
|
||||
'Element: {0}',
|
||||
startingTag($element));
|
||||
}
|
||||
|
||||
|
||||
$transclude(function(clone) {
|
||||
$element.empty();
|
||||
$element.append(clone);
|
||||
|
||||
@@ -9,12 +9,12 @@
|
||||
* Any uncaught exception in angular expressions is delegated to this service.
|
||||
* The default implementation simply delegates to `$log.error` which logs it into
|
||||
* the browser console.
|
||||
*
|
||||
*
|
||||
* In unit tests, if `angular-mocks.js` is loaded, this service is overridden by
|
||||
* {@link ngMock.$exceptionHandler mock $exceptionHandler} which aids in testing.
|
||||
*
|
||||
* ## Example:
|
||||
*
|
||||
*
|
||||
* ```js
|
||||
* angular.module('exceptionOverride', []).factory('$exceptionHandler', function () {
|
||||
* return function (exception, cause) {
|
||||
@@ -23,7 +23,7 @@
|
||||
* };
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* This example will override the normal action of `$exceptionHandler`, to make angular
|
||||
* exceptions fail hard when they happen, instead of just logging to the console.
|
||||
*
|
||||
|
||||
+2
-2
@@ -32,7 +32,7 @@
|
||||
*
|
||||
* The filter function is registered with the `$injector` under the filter name suffix with
|
||||
* `Filter`.
|
||||
*
|
||||
*
|
||||
* ```js
|
||||
* it('should be the same instance', inject(
|
||||
* function($filterProvider) {
|
||||
@@ -106,7 +106,7 @@ function $FilterProvider($provide) {
|
||||
}];
|
||||
|
||||
////////////////////////////////////////
|
||||
|
||||
|
||||
/* global
|
||||
currencyFilter: false,
|
||||
dateFilter: false,
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
* the value and sign (positive or negative) of `limit`.
|
||||
*
|
||||
* @param {Array|string} input Source array or string to be limited.
|
||||
* @param {string|number} limit The length of the returned array or string. If the `limit` number
|
||||
* @param {string|number} limit The length of the returned array or string. If the `limit` number
|
||||
* is positive, `limit` number of items from the beginning of the source array/string are copied.
|
||||
* If the number is negative, `limit` number of items from the end of the source array/string
|
||||
* If the number is negative, `limit` number of items from the end of the source array/string
|
||||
* are copied. The `limit` will be trimmed if it exceeds `array.length`
|
||||
* @returns {Array|string} A new sub-array or substring of length `limit` or less if input array
|
||||
* had less than `limit` elements.
|
||||
@@ -72,7 +72,7 @@
|
||||
function limitToFilter(){
|
||||
return function(input, limit) {
|
||||
if (!isArray(input) && !isString(input)) return input;
|
||||
|
||||
|
||||
limit = int(limit);
|
||||
|
||||
if (isString(input)) {
|
||||
|
||||
+1
-1
@@ -556,7 +556,7 @@ function $HttpProvider() {
|
||||
* - **withCredentials** - `{boolean}` - whether to to set the `withCredentials` flag on the
|
||||
* XHR object. See [requests with credentials]https://developer.mozilla.org/en/http_access_control#section_5
|
||||
* for more information.
|
||||
* - **responseType** - `{string}` - see
|
||||
* - **responseType** - `{string}` - see
|
||||
* [requestType](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#responseType).
|
||||
*
|
||||
* @returns {HttpPromise} Returns a {@link ng.$q promise} object with the
|
||||
|
||||
@@ -112,7 +112,7 @@ function createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDoc
|
||||
// WebKit added support for the json responseType value on 09/03/2013
|
||||
// https://bugs.webkit.org/show_bug.cgi?id=73648. Versions of Safari prior to 7 are
|
||||
// known to throw when setting the value "json" as the response type. Other older
|
||||
// browsers implementing the responseType
|
||||
// browsers implementing the responseType
|
||||
//
|
||||
// The json response type can be ignored if not supported, because JSON payloads are
|
||||
// parsed on the client-side regardless.
|
||||
|
||||
+5
-5
@@ -8,7 +8,7 @@
|
||||
* @description
|
||||
* Simple service for logging. Default implementation safely writes the message
|
||||
* into the browser's console (if present).
|
||||
*
|
||||
*
|
||||
* The main purpose of this service is to simplify debugging and troubleshooting.
|
||||
*
|
||||
* The default is to log `debug` messages. You can use
|
||||
@@ -45,7 +45,7 @@
|
||||
function $LogProvider(){
|
||||
var debug = true,
|
||||
self = this;
|
||||
|
||||
|
||||
/**
|
||||
* @ngdoc property
|
||||
* @name $logProvider#debugEnabled
|
||||
@@ -61,7 +61,7 @@ function $LogProvider(){
|
||||
return debug;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
this.$get = ['$window', function($window){
|
||||
return {
|
||||
/**
|
||||
@@ -99,11 +99,11 @@ function $LogProvider(){
|
||||
* Write an error message
|
||||
*/
|
||||
error: consoleLog('error'),
|
||||
|
||||
|
||||
/**
|
||||
* @ngdoc method
|
||||
* @name $log#debug
|
||||
*
|
||||
*
|
||||
* @description
|
||||
* Write a debug message
|
||||
*/
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@
|
||||
* ```js
|
||||
* // for the purpose of this example let's assume that variables `$q`, `scope` and `okToGreet`
|
||||
* // are available in the current lexical scope (they could have been injected or passed in).
|
||||
*
|
||||
*
|
||||
* function asyncGreet(name) {
|
||||
* var deferred = $q.defer();
|
||||
*
|
||||
|
||||
+1
-1
@@ -446,7 +446,7 @@ function $SceDelegateProvider() {
|
||||
* allowing only the files in a specific directory to do this. Ensuring that the internal API
|
||||
* exposed by that code doesn't markup arbitrary values as safe then becomes a more manageable task.
|
||||
*
|
||||
* In the case of AngularJS' SCE service, one uses {@link ng.$sce#methods_trustAs $sce.trustAs}
|
||||
* In the case of AngularJS' SCE service, one uses {@link ng.$sce#methods_trustAs $sce.trustAs}
|
||||
* (and shorthand methods such as {@link ng.$sce#methods_trustAsHtml $sce.trustAsHtml}, etc.) to
|
||||
* obtain values that will be accepted by SCE / privileged contexts.
|
||||
*
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ function $TimeoutProvider() {
|
||||
* will invoke `fn` within the {@link ng.$rootScope.Scope#methods_$apply $apply} block.
|
||||
* @returns {Promise} Promise that will be resolved when the timeout is reached. The value this
|
||||
* promise will be resolved with is the return value of the `fn` function.
|
||||
*
|
||||
*
|
||||
*/
|
||||
function timeout(fn, delay, invokeApply) {
|
||||
var deferred = $q.defer(),
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
* # ngCookies
|
||||
*
|
||||
* The `ngCookies` module provides a convenient wrapper for reading and writing browser cookies.
|
||||
* The `ngCookies` module provides a convenient wrapper for reading and writing browser cookies.
|
||||
*
|
||||
* {@installModule cookies}
|
||||
*
|
||||
|
||||
@@ -152,7 +152,7 @@ function shallowClearAndCopy(src, dst) {
|
||||
* 'remove': {method:'DELETE'},
|
||||
* 'delete': {method:'DELETE'} };
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* Calling these methods invoke an {@link ng.$http} with the specified http method,
|
||||
* destination and parameters. When the data is returned from the server then the object is an
|
||||
* instance of the resource class. The actions `save`, `remove` and `delete` are available on it
|
||||
@@ -281,7 +281,7 @@ function shallowClearAndCopy(src, dst) {
|
||||
* var app = angular.module('app', ['ngResource', 'ngRoute']);
|
||||
*
|
||||
* // Some APIs expect a PUT request in the format URL/object/ID
|
||||
* // Here we are creating an 'update' method
|
||||
* // Here we are creating an 'update' method
|
||||
* app.factory('Notes', ['$resource', function($resource) {
|
||||
* return $resource('/notes/:id', null,
|
||||
* {
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
*
|
||||
* ## Example
|
||||
* See {@link ngRoute.$route#example $route} for an example of configuring and using `ngRoute`.
|
||||
*
|
||||
*
|
||||
* {@installModule route}
|
||||
*
|
||||
* <div doc-module-components="ngRoute"></div>
|
||||
@@ -28,7 +28,7 @@ var ngRouteModule = angular.module('ngRoute', ['ng']).
|
||||
* @description
|
||||
*
|
||||
* Used for configuring routes.
|
||||
*
|
||||
*
|
||||
* ## Example
|
||||
* See {@link ngRoute.$route#example $route} for an example of configuring and using `ngRoute`.
|
||||
*
|
||||
|
||||
@@ -141,7 +141,7 @@ angular.scenario.ObjectModel.prototype.on = function(eventName, listener) {
|
||||
angular.scenario.ObjectModel.prototype.emit = function(eventName) {
|
||||
var self = this,
|
||||
args = Array.prototype.slice.call(arguments, 1);
|
||||
|
||||
|
||||
eventName = eventName.toLowerCase();
|
||||
|
||||
if (this.listeners[eventName]) {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* # ngTouch
|
||||
*
|
||||
* The `ngTouch` module provides touch events and other helpers for touch-enabled devices.
|
||||
* The implementation is based on jQuery Mobile touch event handling
|
||||
* The implementation is based on jQuery Mobile touch event handling
|
||||
* ([jquerymobile.com](http://jquerymobile.com/)).
|
||||
*
|
||||
* {@installModule touch}
|
||||
|
||||
@@ -727,7 +727,7 @@ describe('ngView animations', function() {
|
||||
$rootScope.$digest();
|
||||
|
||||
//we don't care about the enter animation for the first element
|
||||
$animate.queue.pop();
|
||||
$animate.queue.pop();
|
||||
|
||||
$location.path('/bar');
|
||||
$rootScope.$digest();
|
||||
@@ -756,7 +756,7 @@ describe('ngView animations', function() {
|
||||
$rootScope.$digest();
|
||||
|
||||
//we don't care about the enter animation
|
||||
$animate.queue.shift();
|
||||
$animate.queue.shift();
|
||||
|
||||
var animation = $animate.queue.shift();
|
||||
expect(animation.event).toBe('addClass');
|
||||
@@ -776,7 +776,7 @@ describe('ngView animations', function() {
|
||||
$rootScope.$digest();
|
||||
|
||||
//we don't care about the enter animation
|
||||
$animate.queue.shift();
|
||||
$animate.queue.shift();
|
||||
|
||||
animation = $animate.queue.shift();
|
||||
item = animation.element;
|
||||
|
||||
Reference in New Issue
Block a user