mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-05-16 18:39:51 +08:00
docs(*): fix jshint issues in examples
This commit is contained in:
@@ -108,7 +108,7 @@ Here is a directive which makes any element draggable. Notice the `draggable` at
|
||||
$document.unbind('mousemove', mousemove);
|
||||
$document.unbind('mouseup', mouseup);
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
</file>
|
||||
<file name="index.html">
|
||||
|
||||
@@ -203,7 +203,7 @@ Let's refactor our example and move the currency conversion into a service in an
|
||||
};
|
||||
var convert = function (amount, inCurr, outCurr) {
|
||||
return amount * usdToForeignRates[outCurr] / usdToForeignRates[inCurr];
|
||||
}
|
||||
};
|
||||
|
||||
return {
|
||||
currencies: currencies,
|
||||
@@ -331,7 +331,7 @@ The following example shows how this is done with Angular:
|
||||
|
||||
var convert = function (amount, inCurr, outCurr) {
|
||||
return amount * usdToForeignRates[outCurr] / usdToForeignRates[inCurr];
|
||||
}
|
||||
};
|
||||
|
||||
var refresh = function() {
|
||||
var url = YAHOO_FINANCE_URL_PATTERN.
|
||||
@@ -344,7 +344,7 @@ The following example shows how this is done with Angular:
|
||||
});
|
||||
usdToForeignRates = newUsdToForeignRates;
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
refresh();
|
||||
|
||||
|
||||
@@ -791,7 +791,7 @@ element?
|
||||
$document.unbind('mousemove', mousemove);
|
||||
$document.unbind('mouseup', mouseup);
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
</file>
|
||||
<file name="index.html">
|
||||
@@ -829,7 +829,7 @@ to which tab is active.
|
||||
};
|
||||
|
||||
this.addPane = function(pane) {
|
||||
if (panes.length == 0) {
|
||||
if (panes.length === 0) {
|
||||
$scope.select(pane);
|
||||
}
|
||||
panes.push(pane);
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
// call $anchorScroll()
|
||||
$anchorScroll();
|
||||
}
|
||||
};
|
||||
}
|
||||
</file>
|
||||
<file name="style.css">
|
||||
|
||||
@@ -960,7 +960,7 @@ var VALID_CLASS = 'ng-valid',
|
||||
if (browser.params.browser == 'safari') {
|
||||
// SafariDriver can't handle contenteditable.
|
||||
return;
|
||||
};
|
||||
}
|
||||
var contentEditable = element(by.css('[contenteditable]'));
|
||||
|
||||
expect(contentEditable.getText()).toEqual('Change me!');
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
expect(secondRepeat.findElement(by.model('contact.value')).getAttribute('value'))
|
||||
.toBe('john.smith@example.org');
|
||||
|
||||
firstRepeat.findElement(by.linkText('clear')).click()
|
||||
firstRepeat.findElement(by.linkText('clear')).click();
|
||||
|
||||
expect(firstRepeat.findElement(by.model('contact.value')).getAttribute('value'))
|
||||
.toBe('');
|
||||
@@ -176,7 +176,7 @@
|
||||
expect(secondRepeat.findElement(by.model('contact.value')).getAttribute('value'))
|
||||
.toBe('john.smith@example.org');
|
||||
|
||||
firstRepeat.findElement(by.linkText('clear')).click()
|
||||
firstRepeat.findElement(by.linkText('clear')).click();
|
||||
|
||||
expect(firstRepeat.findElement(by.model('contact.value')).getAttribute('value'))
|
||||
.toBe('');
|
||||
|
||||
@@ -59,8 +59,8 @@
|
||||
<file name="script.js">
|
||||
function Ctrl($scope) {
|
||||
$scope.templates =
|
||||
[ { name: 'template1.html', url: 'template1.html'}
|
||||
, { name: 'template2.html', url: 'template2.html'} ];
|
||||
[ { name: 'template1.html', url: 'template1.html'},
|
||||
{ name: 'template2.html', url: 'template2.html'} ];
|
||||
$scope.template = $scope.templates[0];
|
||||
}
|
||||
</file>
|
||||
|
||||
@@ -642,7 +642,7 @@ function $HttpProvider() {
|
||||
sampleGetBtn.click();
|
||||
fetchBtn.click();
|
||||
expect(status.getText()).toMatch('200');
|
||||
expect(data.getText()).toMatch(/Hello, \$http!/)
|
||||
expect(data.getText()).toMatch(/Hello, \$http!/);
|
||||
});
|
||||
|
||||
it('should make a JSONP request to angularjs.org', function() {
|
||||
|
||||
Reference in New Issue
Block a user