Questions tagged [angularjs-1.6]

Represents questions specific to AngularJS 1.6. This release brings (among others) news on the component method, $http success() and error() and the ngModelOptions inheritence.

Represents questions specific to AngularJS 1.6. This release brings (among others) news on the component method, $http success() and error() and the ngModelOptions inheritence.

Migration from 1.5 to 1.6 is explained in this article from the Angular documentation.

158 questions
102
votes
5 answers

angularjs 1.6.0 (latest now) routes not working

I was expecting to see this question on Stackoverflow but didn't. Apparently I'm the only one having this problem that seems to me to be very common. I have a basic project I am working on but the routes don't seem to work even though everything…
75
votes
11 answers

Angular 1.6.0: "Possibly unhandled rejection" error

We have a pattern for resolving promises in our Angular app that has served us well up until Angular 1.6.0: resource.get().$promise .then(function (response) { // do something with the response }, function (error) { …
Groucho
  • 1,055
  • 1
  • 7
  • 11
64
votes
2 answers

Why are AngularJS $http success/error methods deprecated? Removed from v1.6?

The AngularJS documentation has a Deprecation Notice for the $http success and error methods. Is there a specific reason this abstraction was removed from the library?
philoniare
  • 1,625
  • 1
  • 13
  • 20
56
votes
6 answers

AngularJS All slashes in URL changed to %2F

I'm having a massive problem with AngularJS routing. Up until recently everything has been fine with the following route: $routeProvider.when('/album/:albumId', { controller: 'albumPageController', templateUrl: 'views/album.html' }); and…
MC123
  • 845
  • 2
  • 8
  • 12
54
votes
4 answers

URL hash-bang (#!/) prefix instead of simple hash (#/) in Angular 1.6

My URLs on an AngularJS project have changed from localhost:3000/admin#/ to localhost:3000/admin#!/ since the last time I worked on my project... Nothing found on the web, does someone know what this is ?
Pierre C.
  • 1,591
  • 2
  • 16
  • 29
33
votes
9 answers

Possibly unhandled rejection in Angular 1.6

I have a code with AngularJS: service.doSomething() .then(function(result) { //do something with the result }); In AngularJS 1.5.9 when I have error in the .then() section like: service.doSomething() .then(function(result) { var x…
27
votes
9 answers

Error with $http.get in angularJS -- Success not a Function

Getting this error: angular.min.js:122 TypeError: $http.get(...).success is not a function at getUserInfo (app.js:7) at new (app.js:12) at Object.invoke (angular.min.js:43) at Q.instance (angular.min.js:93) at p…
Manzur Khan
  • 2,366
  • 4
  • 23
  • 44
18
votes
2 answers

AngularJS errors: Blocked loading resource from url not allowed by $sceDelegate policy

I'm currently following a tutorial in AngularJS. This is the code in my controllers.js file. 'use strict'; angular.module ( 'F1FeederApp.controllers' , [] ) .controller ( 'driversController' , function (…
Joeb Rogers
  • 348
  • 1
  • 2
  • 14
12
votes
2 answers

AngularJS Upgrade (1.5 to 1.6,1.7) Makes directive scope bindings undefined

I have the following code: angular .module('myApp') .directive('layout', function () { return { restrict: 'E', template: '
', controller: 'LayoutController', …
11
votes
5 answers

AngularJS 1.6 routing not working

I am trying to create my first angular app. But its not working at all. I have no idea what's the problem. I checked the console, but there's no erros.
Petrus
  • 201
  • 1
  • 4
  • 15
9
votes
6 answers

AngularJS: How to remove #!/ (bang prefix) from URL?

I already have done $locationProvider.html5Mode(true); but it is not working. Whenever I access http://example.com it goes to http://example.com/#!/. Code is given here: var myApp = angular.module('myApp', ['ui.router',…
Volatil3
  • 14,253
  • 38
  • 134
  • 263
7
votes
3 answers

Best practice for using $rootscope in an Angularjs application?

We have a large Angularjs 1.6 application that has $rootscope scattered throughout the app in over 200 places in filters, services, routes, etc.. so it needs to be refactored, but I'm not sure how to know when to remove it. When is it a best…
James Drinkard
  • 15,342
  • 16
  • 114
  • 137
6
votes
1 answer

Upgrade AngularJs 1.5 to 1.6 - which exact bindings are affected by change in $compile reg controller instances?

Documentation for a change in $compile when upgrading from AngularJs 1.5 to 1.6 states: pre-assigning bindings on component/directive controller instances is disabled by default, which means that they will no longer be available inside the…
LBA
  • 3,859
  • 2
  • 21
  • 60
6
votes
3 answers

Executing a function once the page is fully loaded in AngularJS

I would like to execute this function as soon as the page is fully loaded. vm.pointInvoice = () => { if ($stateParams.property == "INVOICE") { vm.invoiceEdit($stateParams.checkin) vm.invoiceFocus = true; …
torbenrudgaard
  • 2,375
  • 7
  • 32
  • 53
6
votes
1 answer

angular-ui-router 1.0.x: event.preventDefault & event.defaultPrevented alternative

I just replaced the $stateChangeStart with $transitions.onStart $rootScope.$on('$stateChangeStart', function(e, ...){ e.preventDefault(); // other code goes here... }); to $transitions.onStart({}, function(tras){ // need a code…
Garfield
  • 2,487
  • 4
  • 31
  • 54
1
2 3
10 11