Reactive-Extensions / rx.angular.js

AngularJS Bindings for RxJS
Other
827 stars 89 forks source link

Update examples to use controllerAs since $scope is considered bad practice now #131

Open MarkPieszak opened 8 years ago

MarkPieszak commented 8 years ago

just thought I'd throw the idea out there. Maybe the examples could be updated to implement a more new best practice?

Also if you're injecting $scope you might as well just use $scope.$watch right?

Roaders commented 8 years ago

Yes, this seems like an excellent idea. I'd love not having to inject $scope and still haven't figured out how to do it.

samal-rasmussen commented 8 years ago

We're using rx.angular on a Angular 1.5 project that's being written from scratch and we're trying to not use $scope anywhere if we can help it, because this is "the angular way" now. Rx.angular is almost the only reason we're injecting $scope anywhere now.

mickdelaney commented 8 years ago

Same for us angular 1.5x with $scope only due to RxJS

Martin-Andersen commented 8 years ago

I am also looking for a way to leave &scope in the dust

ghost commented 7 years ago

I created this simple way of using the $createObservableFunction without using $scope, you can technically wrap it in a service and use the 'rx' injection from rx-angular instead of a global rx object. It's not elegant but it works.

https://gist.github.com/Herman-Scheer/22f49bbbb10f2ef22ffdfc83935de6c5