Skip to content

Commit 3c2ddd8

Browse files
committed
Merge pull request #46 from borgdylan/borgdylan/handles
Support minification + add a gulp file for building
2 parents 8b15a0d + 2af2077 commit 3c2ddd8

File tree

4 files changed

+59
-34
lines changed

4 files changed

+59
-34
lines changed

js/angular-winjs.js

+34-34
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@
312312
//
313313
var module = angular.module("winjs", []);
314314

315-
module.config(function ($compileProvider) {
315+
module.config(['$compileProvider', function ($compileProvider) {
316316
switch (document.location.protocol.toLowerCase()) {
317317
// http://msdn.microsoft.com/en-us/library/windows/apps/xaml/jj655406.aspx
318318
//
@@ -325,9 +325,9 @@
325325
$compileProvider.aHrefSanitizationWhitelist(whitelist);
326326
break;
327327
}
328-
});
328+
}]);
329329

330-
module.run(function ($rootScope) {
330+
module.run(['$rootScope', function ($rootScope) {
331331
var Scope = Object.getPrototypeOf($rootScope);
332332
var Scope$eval = Scope.$eval;
333333
Scope.$eval = function (expr, locals) {
@@ -340,11 +340,11 @@
340340
return Scope$eval.call(that, expr, locals);
341341
}
342342
};
343-
});
343+
}]);
344344

345345
// Directives
346346
//
347-
exists("AppBar") && module.directive("winAppBar", function ($parse) {
347+
exists("AppBar") && module.directive("winAppBar", ['$parse', function ($parse) {
348348
var api = {
349349
closedDisplayMode: BINDING_property,
350350
commands: BINDING_property,
@@ -388,7 +388,7 @@
388388
return appbar;
389389
}
390390
};
391-
});
391+
}]);
392392

393393
exists("AppBar") && module.directive("winAppBarCommand", function () {
394394
var api = {
@@ -511,7 +511,7 @@
511511
};
512512
});
513513

514-
exists("FlipView") && module.directive("winFlipView", function ($parse) {
514+
exists("FlipView") && module.directive("winFlipView", ['$parse', function ($parse) {
515515
var api = {
516516
currentPage: BINDING_property,
517517
itemDataSource: BINDING_dataSource,
@@ -529,9 +529,9 @@
529529
scope: objectMap(api, function (value) { return value.binding; }),
530530
template: "<DIV ng-transclude='true'></DIV>",
531531
transclude: true,
532-
controller: function ($scope) {
532+
controller: ['$scope', function ($scope) {
533533
proxy($scope, this, "itemTemplate");
534-
},
534+
}],
535535
link: function ($scope, elements, attrs) {
536536
var element = elements[0];
537537
var bindings = [];
@@ -542,9 +542,9 @@
542542
return flipView;
543543
}
544544
};
545-
});
545+
}]);
546546

547-
exists("Flyout") && module.directive("winFlyout", function ($parse) {
547+
exists("Flyout") && module.directive("winFlyout", ['$parse', function ($parse) {
548548
var api = {
549549
alignment: BINDING_property,
550550
anchor: BINDING_anchor,
@@ -589,7 +589,7 @@
589589
return flyout;
590590
}
591591
};
592-
});
592+
}]);
593593

594594
exists("GridLayout") && module.directive("winGridLayout", function () {
595595
var api = {
@@ -644,7 +644,7 @@
644644
scope: objectMap(api, function (value) { return value.binding; }),
645645
template: "<DIV><DIV class='placeholder-holder' style='display:none;' ng-transclude='true'></DIV></DIV>",
646646
transclude: true,
647-
controller: function ($scope) {
647+
controller: ['$scope', function ($scope) {
648648
// The children will (may) call back before the Hub is constructed so we queue up the calls to
649649
// addSection and removeSection and execute them later.
650650
$scope.deferredCalls = [];
@@ -665,7 +665,7 @@
665665
this.removeSection = deferred(function (section) {
666666
$scope.removeSection(section);
667667
});
668-
},
668+
}],
669669
link: function ($scope, elements) {
670670
var element = elements[0];
671671
// NOTE: the Hub will complain if this is in the DOM when it is constructed so we temporarially remove it.
@@ -795,7 +795,7 @@
795795
};
796796
});
797797

798-
exists("ListView") && module.directive("winListView", function ($parse) {
798+
exists("ListView") && module.directive("winListView", ['$parse', function ($parse) {
799799
var api = {
800800
currentItem: BINDING_property,
801801
groupDataSource: BINDING_dataSource,
@@ -835,12 +835,12 @@
835835
scope: objectMap(api, function (value) { return value.binding; }),
836836
template: "<DIV ng-transclude='true'></DIV>",
837837
transclude: true,
838-
controller: function ($scope) {
838+
controller: ['$scope', function ($scope) {
839839
proxy($scope, this, "itemTemplate");
840840
proxy($scope, this, "groupHeaderTemplate");
841841
proxy($scope, this, "layout");
842842
proxy($scope, this, "selection");
843-
},
843+
}],
844844
link: function ($scope, elements, attrs) {
845845
var element = elements[0];
846846
var bindings = [];
@@ -863,9 +863,9 @@
863863
return listView;
864864
}
865865
};
866-
});
866+
}]);
867867

868-
exists("Menu") && module.directive("winMenu", function ($parse) {
868+
exists("Menu") && module.directive("winMenu", ['$parse', function ($parse) {
869869
var api = {
870870
alignment: BINDING_property,
871871
anchor: BINDING_anchor,
@@ -909,7 +909,7 @@
909909
return menu;
910910
}
911911
};
912-
});
912+
}]);
913913

914914
exists("MenuCommand") && module.directive("winMenuCommand", function () {
915915
var api = {
@@ -943,7 +943,7 @@
943943
};
944944
});
945945

946-
exists("NavBar") && module.directive("winNavBar", function ($parse) {
946+
exists("NavBar") && module.directive("winNavBar", ['$parse', function ($parse) {
947947
return {
948948
restrict: "E",
949949
replace: true,
@@ -969,7 +969,7 @@
969969
return navbar;
970970
}
971971
};
972-
});
972+
}]);
973973

974974
exists("NavBarCommand") && module.directive("winNavBarCommand", function () {
975975
var api = {
@@ -1014,9 +1014,9 @@
10141014
scope: objectMap(api, function (value) { return value.binding; }),
10151015
template: "<DIV ng-transclude='true'></DIV>",
10161016
transclude: true,
1017-
controller: function ($scope) {
1017+
controller: ['$scope', function ($scope) {
10181018
proxy($scope, this, "template");
1019-
},
1019+
}],
10201020
link: function ($scope, elements) {
10211021
var element = elements[0];
10221022
var bindings = [];
@@ -1046,7 +1046,7 @@
10461046
scope: objectMap(api, function (value) { return value.binding; }),
10471047
template: "<DIV><DIV class='placeholder-holder' style='display:none;' ng-transclude='true'></DIV></DIV>",
10481048
transclude: true,
1049-
controller: function ($scope) {
1049+
controller: ['$scope', function ($scope) {
10501050
// The children will (may) call back before the Pivot is constructed so we queue up the calls to
10511051
// addItem and removeItem and execute them later.
10521052
$scope.deferredCalls = [];
@@ -1066,7 +1066,7 @@
10661066
this.removeItem = deferred(function (item) {
10671067
$scope.removeItem(item);
10681068
});
1069-
},
1069+
}],
10701070
link: function ($scope, elements) {
10711071
var element = elements[0];
10721072
// NOTE: the Pivot will complain if this is in the DOM when it is constructed so we temporarially remove it.
@@ -1159,7 +1159,7 @@
11591159
};
11601160
});
11611161

1162-
exists("SearchBox") && module.directive("winSearchBox", function ($parse) {
1162+
exists("SearchBox") && module.directive("winSearchBox", ['$parse', function ($parse) {
11631163
var api = {
11641164
chooseSuggestionOnEnter: BINDING_property,
11651165
disabled: BINDING_property,
@@ -1195,7 +1195,7 @@
11951195
return searchBox;
11961196
}
11971197
};
1198-
});
1198+
}]);
11991199

12001200
exists("SectionHeaderTemplate") && module.directive("winSectionHeaderTemplate", function () {
12011201
return {
@@ -1301,7 +1301,7 @@
13011301
};
13021302
});
13031303

1304-
exists("Tooltip") && module.directive("winTooltip", function ($parse) {
1304+
exists("Tooltip") && module.directive("winTooltip", ['$parse', function ($parse) {
13051305
var api = {
13061306
contentElement: BINDING_property,
13071307
extraClass: BINDING_property,
@@ -1319,9 +1319,9 @@
13191319
scope: objectMap(api, function (value) { return value.binding; }),
13201320
template: "<DIV ng-transclude='true'></DIV>",
13211321
transclude: true,
1322-
controller: function ($scope) {
1322+
controller: ['$scope', function ($scope) {
13231323
proxy($scope, this, "contentElement");
1324-
},
1324+
}],
13251325
link: function ($scope, elements, attrs) {
13261326
var element = elements[0];
13271327
var bindings = [];
@@ -1332,7 +1332,7 @@
13321332
return tooltip;
13331333
}
13341334
};
1335-
});
1335+
}]);
13361336

13371337
// Tooltop is a little odd because you have to be able to specify both the element
13381338
// which has a tooltip (the content) and the tooltip's content itself. We specify
@@ -1363,7 +1363,7 @@
13631363
//surface winControl property as win-control directive
13641364
//keep priority set to a higher value than others (default is 0)
13651365
//as 'link' ie. postLink functions run highest priority last
1366-
module.directive("winControl", function ($parse) {
1366+
module.directive("winControl", ['$parse', function ($parse) {
13671367
return {
13681368
restrict: "A",
13691369
priority: 1,
@@ -1373,6 +1373,6 @@
13731373
}
13741374
}
13751375
};
1376-
});
1376+
}]);
13771377

13781378
}(this));

0 commit comments

Comments
 (0)