angularjs-1.6

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

拟墨画扇 提交于 2019-12-05 07:44:50
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 constructors. — AngularJS Developer Guide - Migrating to V1.6 - $compile The upgrade example in the documentation is as follows (shortened): Before .component('myComponent', { bindings: {value: '<'}, controller: function() { //... } }) After .component('myComponent', { bindings: {value: '<'}, controller: function() { this.$onInit = function() { // ... }; } }

Angular 1.6.3 is not allowing a JSONP request that was allowed in 1.5.8

爷,独闯天下 提交于 2019-12-05 01:22:11
问题 Angular 1.6.3 is not allowing a request that was allowed in 1.5.8 and I am getting this error: $sce:insecurl Processing of a Resource from Untrusted Source Blocked The full error is available here. I would like to upgrade my version of angular to 1.6.3 to get the latest and greatest, but I am dependent on this API. Is there a way for me to mark this as a trusted API or another way to use this API? What is the difference between these two versions that is causing this? Here is the code that I

AngularJS -$compileProvider.preAssignBindingsEnabled is not a function

不羁的心 提交于 2019-12-04 04:11:37
问题 I'm getting the following error message when attempting to do a gulp serve on my AngularJS (ver 1.6.10) app: Error: [$injector:modulerr] Failed to instantiate module myAppName due to: $compileProvider.preAssignBindingsEnabled is not a function @http://localhost:9805/app/scripts/app.js:43:9 invoke@http://localhost:9805/lib/angular/angular.js:5108:16 runInvokeQueue@http://localhost:9805/lib/angular/angular.js:4997:11 loadModules/<@http://localhost:9805/lib/angular/angular.js:5007:11 forEach

Angular 1.6.3 is not allowing a JSONP request that was allowed in 1.5.8

我与影子孤独终老i 提交于 2019-12-03 16:38:07
Angular 1.6.3 is not allowing a request that was allowed in 1.5.8 and I am getting this error: $sce:insecurl Processing of a Resource from Untrusted Source Blocked The full error is available here . I would like to upgrade my version of angular to 1.6.3 to get the latest and greatest, but I am dependent on this API. Is there a way for me to mark this as a trusted API or another way to use this API? What is the difference between these two versions that is causing this? Here is the code that I am trying to run: var app = angular.module('app', []); app.controller('firstController', ['$http',

how to bind default value to select using ng-model using AngularJS V1.6

醉酒当歌 提交于 2019-12-02 01:42:30
问题 <select ng-model="machineSelected" ng-options="machine._id as machine.name for machine in machineList" ng-change="onChangeMachine(machineSelected)" ng-disabled="!mineSelected"> <!--<option value=""></option>--> <option value="">Select</option> </select> When I add $scope.machineSelected = ""; dynamically wherever in the controller, option in drop-down should set as "Select", but it is not updating. 回答1: Use null or undefined , not an empty string, as the "not selected" value. That's what the

Angular Route - Extra # in URL

↘锁芯ラ 提交于 2019-12-02 01:27:43
Learning some Angular - and I'm stuck on routing Here is my angular config var meanApp = angular.module('carz', ['ngRoute']); meanApp.config(function($routeProvider) { $routeProvider .when('/', { templateUrl: 'home.html', controller: 'mainCtrl' }) .when('/red', { templateUrl: 'red.html', controller: 'redCtrl' }); }); Here is are my links <a href="#">Home</a> <a href="#red">Red</a> When I load up my node app I am directed to http://localhost:8080/#!/ And I get my angular controller working as expected within the ng-view tags But I cannot switch from one controller to the other using the links

how to bind default value to select using ng-model using AngularJS V1.6

江枫思渺然 提交于 2019-12-02 00:48:26
<select ng-model="machineSelected" ng-options="machine._id as machine.name for machine in machineList" ng-change="onChangeMachine(machineSelected)" ng-disabled="!mineSelected"> <!--<option value=""></option>--> <option value="">Select</option> </select> When I add $scope.machineSelected = ""; dynamically wherever in the controller, option in drop-down should set as "Select", but it is not updating. Use null or undefined , not an empty string, as the "not selected" value. That's what the docs say: Optionally, a single hard-coded <option> element, with the value set to an empty string, can be

AngularJS -$compileProvider.preAssignBindingsEnabled is not a function

徘徊边缘 提交于 2019-12-01 21:18:40
I'm getting the following error message when attempting to do a gulp serve on my AngularJS (ver 1.6.10) app: Error: [$injector:modulerr] Failed to instantiate module myAppName due to: $compileProvider.preAssignBindingsEnabled is not a function @http://localhost:9805/app/scripts/app.js:43:9 invoke@http://localhost:9805/lib/angular/angular.js:5108:16 runInvokeQueue@http://localhost:9805/lib/angular/angular.js:4997:11 loadModules/<@http://localhost:9805/lib/angular/angular.js:5007:11 forEach@http://localhost:9805/lib/angular/angular.js:387:11 loadModules@http://localhost:9805/lib/angular/angular

Possibly unhandled rejection in Angular 1.6

半世苍凉 提交于 2019-11-29 02:52:33
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 = null; var y = x.y; //do something with the result }); I'm getting clear error message: TypeError: Cannot read property 'y' of null But in version 1.6 with the same code I'm getting a different error: Possibly unhandled rejection: {} undefined I know that this is related to this change , and the single solution is quite simple by adding .catch() block: service

Routing issue with AngularJS project using yeoman setup [duplicate]

筅森魡賤 提交于 2019-11-28 00:33:38
This question already has an answer here: AngularJS: How to remove #!/ (bang prefix) from URL? 6 answers I have setup a new Angular project using yeoman. Angular version is 1.6.0. Project setup was successful but I have been facing an issue with routing Task runner - Grunt When I run the project in local my local page will load with URL http://localhost:9000/#!/ I was expecting http://localhost:9000/#/ When clicked on About link browser is routed to http://localhost:9000/#!/%23%2Fabout Expectation: http://localhost:9000/#/about When I click home link browser is routed to http://localhost:9000/