-
Notifications
You must be signed in to change notification settings - Fork 89
Letter casing conventions #121
Comments
I only started using Depends on which object you want to call, Hope this helps! |
Thanks for the response, @tihuan. I'm not sure I understand the value of making both Using angular
.module('example')
.controller('AppCtrl', AppCtrl);
AppCtrl.$inject = ['$scope', '$http', 'rx'];
function AppCtrl($scope, $http, Rx) {
function searchWikipedia (term) {
return Rx.Observable
.fromPromise($http({
url: "http://en.wikipedia.org/w/api.php?&callback=JSON_CALLBACK",
method: "jsonp",
params: {
action: "opensearch",
search: term,
format: "json"
}
}))
.map(function(response){ return response.data[1]; });
}
$scope.search = '';
$scope.results = [];
/*
Creates a "click" function which is an observable sequence instead of just a function.
*/
$scope.$createObservableFunction('click')
.map(function () { return $scope.search; })
.flatMapLatest(searchWikipedia)
.subscribe(function(results) {
$scope.results = results;
});
} |
Hey @ariutta, thanks for the detailed explanation! I see what you mean now 🎅 Do you think it'd be even more consistent if
This way |
Hmm... I believe the injected AppCtrl.$inject = ['$scope', '$http', 'rx'];
function AppCtrl($scope, $http, rx) {
rx === window.Rx
} vs. (warning: the following would not work with Implicit Annotation) AppCtrl.$inject = ['$scope', '$http', 'rx'];
function AppCtrl($scope, $http, Rx) {
Rx === window.Rx
} vs. (note: the following would require changing rx.angular.js) AppCtrl.$inject = ['$scope', '$http', 'Rx'];
function AppCtrl($scope, $http, Rx) {
Rx === window.Rx
} See also the JS from this plunkr vs. this one. Maybe the current code uses lowercase |
Ooh, that's why! But if lowerCamelCase is the convention of Angular, then I guess there's no chance that we can use the third approach :/ (using Thanks so much for including Plunkr examples for this, btw. Super helpful! 👍 |
Hello,
Minor question -- why do the examples for this repo use lower case
rx
when the examples for RxJS and RxNode use capitals (Rx
andRxNode
)? For the RxJS ecosystem, is there a convention on when to preferrx
vs.Rx
?Thanks!
The text was updated successfully, but these errors were encountered: