-
Notifications
You must be signed in to change notification settings - Fork 512
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove bind for stPipe #200
Comments
Or just use a variable to identify your controller in a closure of the pipe function. var self=this;
function customPipe(tablestate){
// this refer to the table controller
// self refer to your controller
} But you are right it is anyway a bad practice to bind a function to a "hidden this" I should pass the table controller instance as parameter of the function. |
I appreciate the quick reply. I could as you instructed. But, like I mentioned: I am using Will there be any updates soon? Thanks. |
It still uses stTable's // js
var vm = this,
collection = [];
vm.collection = collection;
vm.getPageData = getPageData;
function getPageData(query) {
...
.then(fn..)
.catch(fn..);
}
$scope.call = function(tableState) {
vm.callServer(tableState);
} <!-- template (controllerAs syntax) -->
<table st-table="scholarships.collection" class="table table-hover table-clickable" st-pipe="call"> |
not sure to understand your problem now ? |
See this plunkr. In this case, |
If you really want to use |
I was using the "bind" in a wrong way. I tried to pass it to the Alright! Thanks again, sir. |
Hi @lorenzofox3 and @srph, what I need is almost that, I'm reusing the same table with different data, and I need set in the function of st-pipe attribute a param to let the function knows how work it, something like this
I hope this be clear because my english is not pretty good!! |
The
stPipe
directive is causing me issues. In my case, I am using a Base Controller, using$controller
to be prototypically inheritted. Here's a plunkr for demonstration purposes.With
this
being binded to the function, this causes me issues: I am unable to access my own controller'sthis
. Perhaps a version ofstPipe
without the bind (st-pipe-no-bind
, ...)?The text was updated successfully, but these errors were encountered: