AngularJS Internet Explorer 9 - angularjs

I have small trouble with angularjs and internet explorer9. It look like, that angularjs is not loading correctly. If I starting ie with my application, nothing will work, but if I start the development tools of ie9 and refresh the page, my application will work and everything is loading and ready to use.
I have no idea, what happen and how to solve this issue. I using angularJs Version 1.1.5. Big thanks!
Update & Resolved
My problem was, that I had everywhere console.log (..). On FF or Chrome, everything works, but with II9, something happens, that ie stop after the statement console.log(...); After removing console.log(..) from my JavaScript, my application also works on IE7/8/9.
But ??
But I would ask why IE has so much problems with console.log?

I run in to the same issue and what fixed it was creating window console in the parent controller before using it. You can add the following code and try.
window.console = window.console || {};
window.console.log = window.console.log || function() {};

Use $log service. It will be injected in your controllers.
https://docs.angularjs.org/api/ng/service/$log

Are you making a call to console.log in your code?
If yes, this will not be available in IE unless you open the dev tools.

Related

Why changeing ng-controller to data-ng-controller caused my controller to start firing

I was having an issue where my LoginController was not firing. A console.log('test'); was not running and no breakpoints where being hit.
The only change that worked was changing ng-controller to data-ng-controller, I didn't have a reason just chancing it after trying a lot of other things. The only difference between these two that I've read is for compatibility for old IE8 but im running the latest chrome canary.
My issue is currently solved but id like to have an idea why, as I don't know why the controller wasn't working in the first place I had implemented it the same as any other in the project

AngularJS route stops working on a local port

I am using AngularJS to build a web app. I use ngRoute for routing and templating. I use gulp-serve to start my website locally. Once for few days it suddenly stops working. After I change local port it works ok.
For example: First it worked on port localhost:3000, but stopped and doesn`t work anymore
then the same with ports 3001,3002,3003,3004
Stopped working means it doesnt load template any more. If I try to access template file directly it is ok, but angular isnt loading it. In debug console there are no messages.
Can somebody explain how is it possible.
I guess I am not in a position to give you a 100% perfect explanation of this issue, but I am assuming that somewhere in your gulp-serve config the default to serve your app is set to port:3000. By attempting to reach the other ports you listed your app is not loading...
The problem was somewhere in cookies. After I clear cookie it goes ok. I use Auth0 service for logging. Maybe the problem is somewhere in their angularjs sdk.

ui-router doesn't load states

i have little problem with my code:
https://github.com/burnpiro/angular-blog
live version is available on http://erdem.pl/#/
Problem is that after deploying it on my server routing doesn't work. ui-router not even trying to load template or controller into ui-view. Application starts and configs are fired (tried with console.log). Even resolve option in home state is fired (PostService). But somehow it cannot load template. If i access template manually:
erdem.pl/components/home/home.html
it is there. The same with controller. If anyone have any ideas please let me know. It happened after deploy. Before that on my local machine it seems to work fine but now after getting project again and deploying it on my local it has the same error.
There is no JS errors or any network errors.
Thanks for help,
I'm not completely sure, but I think the issue is with the host you've set in your config.js file? This should be pointed to the public link for wherever your api lives. Should it be "http://erdem.pl"?
I've also noticed that Restangular doesn't seem to be sending your requests. I see that the execution gets into the RequestInterceptor, but I don't see them in the Network tab of my developer tools. This means that your promises from your resolve properties on your states will never be resolved. Your states are configured to wait for these resolve requests to resolve before initializing the controller and loading the template.
EDIT: I think I found the issue!
Looks like Restangular is only compatible with Lodash 3.10, anything after that causes compatibility issues. Downgrade to 3.10 and hopefully it works for you!

Angular not working but not posting any errors to the console

I have a pretty basic Angular app.
When I try to run it in the browser, the page is blank. But no errors show up in the Chrome console.
Could this have been turned off somehow?
UPDATE
I found the problem to be that I gave angular.module(...) a variable name, but forgot to update the chained calls with the variable. So it looked like this.
var app = angular.module(....);
.config(..);
However, I'm still wondering why I didn't see that error in Chrome

AngularJS Data Binding issue on Internet Explorer compatibility mode using Curly Braces

I followed http://docs.angularjs.org/guide/ie when developing my web page. But in IE8/9/10 with compatibility Mode, the page is showing up with {{}} and the data is not getting binded. I am using angular-1.0.5.min.js version and have the following.
Please help on how to resolve this issue.
When I find something only works with developer tools open, the usual culprit turns out to be that I'm using console.log(...).
Is it possible that you are using console.log() or similar calls that are only available when the developer tools are open?
When developer tools aren't open, console is undefined, and scripts fall over when you call console.log.
If this is the problem and you want to keep the log calls in your code you could stub out console.log like:
window.console = window.console || {};
window.console.log = window.console.log || function() {};
Try bootstrapping angular manually
<script>
$(document).ready(function() {
angular.bootstrap(document);
});
</script>

Resources