Update AngularJS to 1.5

This commit is contained in:
Michal Miszczyszyn
2016-02-18 01:45:25 +01:00
parent 9c2dd05cb4
commit 65347efe70
9 changed files with 2513 additions and 94 deletions

View File

@@ -62,6 +62,10 @@ angular.module('http-auth-interceptor', [])
*/
.config(['$httpProvider', 'authServiceProvider', <any>function ($httpProvider: ng.IHttpProvider, authServiceProvider: any) {
$httpProvider.defaults.headers.common = {'Authorization': 'Bearer token'};
$httpProvider.defaults.headers.get['Authorization'] = 'Bearer token';
$httpProvider.defaults.headers.post['Authorization'] = function (config:ng.IRequestConfig):string { return 'Bearer token'; }
var interceptor = ['$rootScope', '$q', <any>function ($rootScope: ng.IScope, $q: ng.IQService) {
function success(response: ng.IHttpPromiseCallbackArg<any>) {
return response;
@@ -510,6 +514,7 @@ test_IAttributes({
$normalize: function (classVal){ return "foo" },
$addClass: function (classVal){},
$removeClass: function(classVal){},
$updateClass: function(newClass, oldClass){},
$set: function(key, value){},
$observe: function(name: any, fn: any){
return fn;
@@ -748,6 +753,7 @@ angular.module('docsTransclusionExample', [])
};
});
angular.module('docsIsoFnBindExample', [])
.controller('Controller', ['$scope', '$timeout', function($scope: any, $timeout: any) {
$scope.name = 'Tobias';
@@ -847,6 +853,30 @@ angular.module('docsTabsExample', [])
};
});
angular.module('componentExample', [])
.component('counter', {
require: ['^ctrl'],
bindings: {
count: '='
},
controller: 'CounterCtrl',
controllerAs: 'counterCtrl',
template: function () {
return '';
},
transclude: {
'el': 'target'
}
})
.component('anotherCounter', {
controller: function(){},
require: {
'parent': '^parentCtrl'
},
template: '',
transclude: true
});
interface copyExampleUser {
name?: string;
email?: string;