Skip to content
This repository has been archived by the owner on Feb 7, 2023. It is now read-only.

c.setClass is not a function #39

Open
dud3 opened this issue Jul 20, 2014 · 9 comments
Open

c.setClass is not a function #39

dud3 opened this issue Jul 20, 2014 · 9 comments

Comments

@dud3
Copy link

dud3 commented Jul 20, 2014

Hi I'm trying to use the injection, but when I try to multiple select items i get the following error: c.setclass is not a function

What might be the problem ?

Thanks

@runxc1
Copy link
Contributor

runxc1 commented Jul 21, 2014

You are giving too little information to be of use. Setup a plunkr that demonstrates the error and post a link

@dud3
Copy link
Author

dud3 commented Jul 21, 2014

@runxc1
Sorry, ti seems that I can't Setup a plunkr, but I can describe it in more details.

First of all I changed the main templeteURL on the main file to: templateUrl: '/scripts/templates/multiselect.tmpl.html', since it was trying to find it on the same folder of the URL(in this case a PHP MVC controller).
After that change it could display the template.

I thought that there was something wrong with my code, then I tried from the examples:
JS:

    $scope.cars = [{id:1, name: 'Audi'}, {id:2, name: 'BMW'}, {id:1, name: 'Honda'}];
    $scope.selectedCar = [];
    ...

HTML:

   <multiselect class="input-xlarge" multiple="true"
        ng-model="selectedCar"
        options="c.name for c in cars"
        change="selected()" >
</multiselect>

As a Result I got the following:
ex_dropdown_1

The behavior:
After Selecting an item the drop-down automatically closed it self, but the scopes were populated and it showed me the the number of selected items, but the only problem was that it didn't assign tick symbols(which probably are the ones of bootstrap).

Error type: c.setClass is not a function

Please let me know if you need further explanation.

@amitava82
Copy link
Owner

It could be new version of AngularJS? I'm sorry I've not worked on angular for a long time, not sure if anything changed after 1.2

@dud3
Copy link
Author

dud3 commented Jul 21, 2014

@amitava82
That's what exactly I was thinking, my angular version is the latest one, I can't degrade it because I have more than 10 more dependencies, that depend on it, is it OK if I try to fix it this weekend so it will fit with the latest version of angular js, and maybe make a pull request ?

@amitava82
Copy link
Owner

Sure that would be great! I've been busy with ReactJS, some help would be nice.

@runxc1
Copy link
Contributor

runxc1 commented Jul 21, 2014

I have been using the library with multiple version of Angular 1.2 probably up to 1.2.16 without any issues though I haven't updated past that point.

Here is a plunkr I setup 4 months ago using 1.2.15 http://plnkr.co/edit/prvoHr?p=preview

@dud3
Copy link
Author

dud3 commented Jul 21, 2014

@runxc1 true it works with 1.2.16 (my app version) on the plunkr, but acts strangely on my app, wired.

Could it be because on my main configuration i changed the interpolateProvider:

 $interpolateProvider.startSymbol('<*');
 $interpolateProvider.endSymbol('*>');

Because it runs into a conflict with the MVC template engine, since they both use the same syntax {{ }} to render.

@amitava82
Copy link
Owner

@dud3 are you using JADE? Don't know if this is related angular/angular.js#6419

@dud3
Copy link
Author

dud3 commented Jul 22, 2014

@amitava82
I'm actually using Blade Templating engine, but it might be the similar problem I guess.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants