1

I ran into a weird problem that I could not figure out, I could not get a good explanation even after searching on the internet.

I have a application (webpage) which consists of ui-bootstrap's accrodion element which gets the data from a json file by $http request. This part is working perfectly fine. Now I wanted to add a multiselect dropdown and I wanted to use the element provided in ui-select. But when I add the dependencies 'ngSanitize' and 'ui-select' in the module, the application doesn't work. I haven't added any dropdown elements, just the dependencies. I don't understand where the problem is.

The original application controller

var app = angular.module('callApp', ['ui.bootstrap']);
app.controller('firstController', function($scope, $http, $modal, $log) {
    //some functions are defined here
});
angular.module('callApp').service('popupService', function () {
    //service is defined
});

Then i added the dependencies ngSanitize and ui.select

var app = angular.module('callApp', ['ui.bootstrap', 'ngSanitize', 'ui.select']);
app.controller('firstController', function($scope, $http, $modal, $log) {
    //some functions are defined here
});
angular.module('callApp').service('popupService', function () {
    //service is defined
});

Now the application doesn't work. I haven't modified any other function or added any elements in the html. Why does such a problem arrive? Is there anything wrong with the declaration?

3
  • 1
    What error does it give in the console if any? Commented Jun 5, 2015 at 10:38
  • 1
    Just checking the obvious - did u bower install and add a <script src=""> in your html for those modules? Commented Jun 5, 2015 at 10:44
  • It does not give any error, the elements are not displayed. I tried $log.info("hi") inside the controller, but that part is not executed. I have done bower install and added script src Commented Jun 5, 2015 at 10:45

1 Answer 1

1

Have you added the reference to the js files to your html page too?

What errors do you see in the console (press F12)?

If the reference to the js files exist in your html then just check the paths are correctly pointing to the actual path.

Regards,

Sign up to request clarification or add additional context in comments.

9 Comments

This should be a comment, not an answer.
And that should be a comment against the question, not your (non)answer.
@swordfish12, when you say elements are not displayed, do you mean you see a blank page or the page partially loads? For debug purposes use the non minified angular.js reference in your html file to get detailed error message.
So you think it's a good idea to post an answer to get around the restrictions? Those blocks are there for a reason and it's pretty simple to get the 50 reputation to post comments. You should go and do that first.
@swordfish12, in that case I'm pretty sure its due to how you're referencing it. Can you show us the <script src=""> section you have in your html file please. Oh and can you try removing reference to 'ngSanitize' (leave 'ui.select') then visa versa to make sure its not just one dependency that's failing?
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.