|
312 | 312 | //
|
313 | 313 | var module = angular.module("winjs", []);
|
314 | 314 |
|
315 |
| - module.config(function ($compileProvider) { |
| 315 | + module.config(['$compileProvider', function ($compileProvider) { |
316 | 316 | switch (document.location.protocol.toLowerCase()) {
|
317 | 317 | // http://msdn.microsoft.com/en-us/library/windows/apps/xaml/jj655406.aspx
|
318 | 318 | //
|
|
325 | 325 | $compileProvider.aHrefSanitizationWhitelist(whitelist);
|
326 | 326 | break;
|
327 | 327 | }
|
328 |
| - }); |
| 328 | + }]); |
329 | 329 |
|
330 |
| - module.run(function ($rootScope) { |
| 330 | + module.run(['$rootScope', function ($rootScope) { |
331 | 331 | var Scope = Object.getPrototypeOf($rootScope);
|
332 | 332 | var Scope$eval = Scope.$eval;
|
333 | 333 | Scope.$eval = function (expr, locals) {
|
|
340 | 340 | return Scope$eval.call(that, expr, locals);
|
341 | 341 | }
|
342 | 342 | };
|
343 |
| - }); |
| 343 | + }]); |
344 | 344 |
|
345 | 345 | // Directives
|
346 | 346 | //
|
347 |
| - exists("AppBar") && module.directive("winAppBar", function ($parse) { |
| 347 | + exists("AppBar") && module.directive("winAppBar", ['$parse', function ($parse) { |
348 | 348 | var api = {
|
349 | 349 | closedDisplayMode: BINDING_property,
|
350 | 350 | commands: BINDING_property,
|
|
388 | 388 | return appbar;
|
389 | 389 | }
|
390 | 390 | };
|
391 |
| - }); |
| 391 | + }]); |
392 | 392 |
|
393 | 393 | exists("AppBar") && module.directive("winAppBarCommand", function () {
|
394 | 394 | var api = {
|
|
511 | 511 | };
|
512 | 512 | });
|
513 | 513 |
|
514 |
| - exists("FlipView") && module.directive("winFlipView", function ($parse) { |
| 514 | + exists("FlipView") && module.directive("winFlipView", ['$parse', function ($parse) { |
515 | 515 | var api = {
|
516 | 516 | currentPage: BINDING_property,
|
517 | 517 | itemDataSource: BINDING_dataSource,
|
|
529 | 529 | scope: objectMap(api, function (value) { return value.binding; }),
|
530 | 530 | template: "<DIV ng-transclude='true'></DIV>",
|
531 | 531 | transclude: true,
|
532 |
| - controller: function ($scope) { |
| 532 | + controller: ['$scope', function ($scope) { |
533 | 533 | proxy($scope, this, "itemTemplate");
|
534 |
| - }, |
| 534 | + }], |
535 | 535 | link: function ($scope, elements, attrs) {
|
536 | 536 | var element = elements[0];
|
537 | 537 | var bindings = [];
|
|
542 | 542 | return flipView;
|
543 | 543 | }
|
544 | 544 | };
|
545 |
| - }); |
| 545 | + }]); |
546 | 546 |
|
547 |
| - exists("Flyout") && module.directive("winFlyout", function ($parse) { |
| 547 | + exists("Flyout") && module.directive("winFlyout", ['$parse', function ($parse) { |
548 | 548 | var api = {
|
549 | 549 | alignment: BINDING_property,
|
550 | 550 | anchor: BINDING_anchor,
|
|
589 | 589 | return flyout;
|
590 | 590 | }
|
591 | 591 | };
|
592 |
| - }); |
| 592 | + }]); |
593 | 593 |
|
594 | 594 | exists("GridLayout") && module.directive("winGridLayout", function () {
|
595 | 595 | var api = {
|
|
644 | 644 | scope: objectMap(api, function (value) { return value.binding; }),
|
645 | 645 | template: "<DIV><DIV class='placeholder-holder' style='display:none;' ng-transclude='true'></DIV></DIV>",
|
646 | 646 | transclude: true,
|
647 |
| - controller: function ($scope) { |
| 647 | + controller: ['$scope', function ($scope) { |
648 | 648 | // The children will (may) call back before the Hub is constructed so we queue up the calls to
|
649 | 649 | // addSection and removeSection and execute them later.
|
650 | 650 | $scope.deferredCalls = [];
|
|
665 | 665 | this.removeSection = deferred(function (section) {
|
666 | 666 | $scope.removeSection(section);
|
667 | 667 | });
|
668 |
| - }, |
| 668 | + }], |
669 | 669 | link: function ($scope, elements) {
|
670 | 670 | var element = elements[0];
|
671 | 671 | // NOTE: the Hub will complain if this is in the DOM when it is constructed so we temporarially remove it.
|
|
795 | 795 | };
|
796 | 796 | });
|
797 | 797 |
|
798 |
| - exists("ListView") && module.directive("winListView", function ($parse) { |
| 798 | + exists("ListView") && module.directive("winListView", ['$parse', function ($parse) { |
799 | 799 | var api = {
|
800 | 800 | currentItem: BINDING_property,
|
801 | 801 | groupDataSource: BINDING_dataSource,
|
|
835 | 835 | scope: objectMap(api, function (value) { return value.binding; }),
|
836 | 836 | template: "<DIV ng-transclude='true'></DIV>",
|
837 | 837 | transclude: true,
|
838 |
| - controller: function ($scope) { |
| 838 | + controller: ['$scope', function ($scope) { |
839 | 839 | proxy($scope, this, "itemTemplate");
|
840 | 840 | proxy($scope, this, "groupHeaderTemplate");
|
841 | 841 | proxy($scope, this, "layout");
|
842 | 842 | proxy($scope, this, "selection");
|
843 |
| - }, |
| 843 | + }], |
844 | 844 | link: function ($scope, elements, attrs) {
|
845 | 845 | var element = elements[0];
|
846 | 846 | var bindings = [];
|
|
863 | 863 | return listView;
|
864 | 864 | }
|
865 | 865 | };
|
866 |
| - }); |
| 866 | + }]); |
867 | 867 |
|
868 |
| - exists("Menu") && module.directive("winMenu", function ($parse) { |
| 868 | + exists("Menu") && module.directive("winMenu", ['$parse', function ($parse) { |
869 | 869 | var api = {
|
870 | 870 | alignment: BINDING_property,
|
871 | 871 | anchor: BINDING_anchor,
|
|
909 | 909 | return menu;
|
910 | 910 | }
|
911 | 911 | };
|
912 |
| - }); |
| 912 | + }]); |
913 | 913 |
|
914 | 914 | exists("MenuCommand") && module.directive("winMenuCommand", function () {
|
915 | 915 | var api = {
|
|
943 | 943 | };
|
944 | 944 | });
|
945 | 945 |
|
946 |
| - exists("NavBar") && module.directive("winNavBar", function ($parse) { |
| 946 | + exists("NavBar") && module.directive("winNavBar", ['$parse', function ($parse) { |
947 | 947 | return {
|
948 | 948 | restrict: "E",
|
949 | 949 | replace: true,
|
|
969 | 969 | return navbar;
|
970 | 970 | }
|
971 | 971 | };
|
972 |
| - }); |
| 972 | + }]); |
973 | 973 |
|
974 | 974 | exists("NavBarCommand") && module.directive("winNavBarCommand", function () {
|
975 | 975 | var api = {
|
|
1014 | 1014 | scope: objectMap(api, function (value) { return value.binding; }),
|
1015 | 1015 | template: "<DIV ng-transclude='true'></DIV>",
|
1016 | 1016 | transclude: true,
|
1017 |
| - controller: function ($scope) { |
| 1017 | + controller: ['$scope', function ($scope) { |
1018 | 1018 | proxy($scope, this, "template");
|
1019 |
| - }, |
| 1019 | + }], |
1020 | 1020 | link: function ($scope, elements) {
|
1021 | 1021 | var element = elements[0];
|
1022 | 1022 | var bindings = [];
|
|
1046 | 1046 | scope: objectMap(api, function (value) { return value.binding; }),
|
1047 | 1047 | template: "<DIV><DIV class='placeholder-holder' style='display:none;' ng-transclude='true'></DIV></DIV>",
|
1048 | 1048 | transclude: true,
|
1049 |
| - controller: function ($scope) { |
| 1049 | + controller: ['$scope', function ($scope) { |
1050 | 1050 | // The children will (may) call back before the Pivot is constructed so we queue up the calls to
|
1051 | 1051 | // addItem and removeItem and execute them later.
|
1052 | 1052 | $scope.deferredCalls = [];
|
|
1066 | 1066 | this.removeItem = deferred(function (item) {
|
1067 | 1067 | $scope.removeItem(item);
|
1068 | 1068 | });
|
1069 |
| - }, |
| 1069 | + }], |
1070 | 1070 | link: function ($scope, elements) {
|
1071 | 1071 | var element = elements[0];
|
1072 | 1072 | // NOTE: the Pivot will complain if this is in the DOM when it is constructed so we temporarially remove it.
|
|
1159 | 1159 | };
|
1160 | 1160 | });
|
1161 | 1161 |
|
1162 |
| - exists("SearchBox") && module.directive("winSearchBox", function ($parse) { |
| 1162 | + exists("SearchBox") && module.directive("winSearchBox", ['$parse', function ($parse) { |
1163 | 1163 | var api = {
|
1164 | 1164 | chooseSuggestionOnEnter: BINDING_property,
|
1165 | 1165 | disabled: BINDING_property,
|
|
1195 | 1195 | return searchBox;
|
1196 | 1196 | }
|
1197 | 1197 | };
|
1198 |
| - }); |
| 1198 | + }]); |
1199 | 1199 |
|
1200 | 1200 | exists("SectionHeaderTemplate") && module.directive("winSectionHeaderTemplate", function () {
|
1201 | 1201 | return {
|
|
1301 | 1301 | };
|
1302 | 1302 | });
|
1303 | 1303 |
|
1304 |
| - exists("Tooltip") && module.directive("winTooltip", function ($parse) { |
| 1304 | + exists("Tooltip") && module.directive("winTooltip", ['$parse', function ($parse) { |
1305 | 1305 | var api = {
|
1306 | 1306 | contentElement: BINDING_property,
|
1307 | 1307 | extraClass: BINDING_property,
|
|
1319 | 1319 | scope: objectMap(api, function (value) { return value.binding; }),
|
1320 | 1320 | template: "<DIV ng-transclude='true'></DIV>",
|
1321 | 1321 | transclude: true,
|
1322 |
| - controller: function ($scope) { |
| 1322 | + controller: ['$scope', function ($scope) { |
1323 | 1323 | proxy($scope, this, "contentElement");
|
1324 |
| - }, |
| 1324 | + }], |
1325 | 1325 | link: function ($scope, elements, attrs) {
|
1326 | 1326 | var element = elements[0];
|
1327 | 1327 | var bindings = [];
|
|
1332 | 1332 | return tooltip;
|
1333 | 1333 | }
|
1334 | 1334 | };
|
1335 |
| - }); |
| 1335 | + }]); |
1336 | 1336 |
|
1337 | 1337 | // Tooltop is a little odd because you have to be able to specify both the element
|
1338 | 1338 | // which has a tooltip (the content) and the tooltip's content itself. We specify
|
|
1363 | 1363 | //surface winControl property as win-control directive
|
1364 | 1364 | //keep priority set to a higher value than others (default is 0)
|
1365 | 1365 | //as 'link' ie. postLink functions run highest priority last
|
1366 |
| - module.directive("winControl", function ($parse) { |
| 1366 | + module.directive("winControl", ['$parse', function ($parse) { |
1367 | 1367 | return {
|
1368 | 1368 | restrict: "A",
|
1369 | 1369 | priority: 1,
|
|
1373 | 1373 | }
|
1374 | 1374 | }
|
1375 | 1375 | };
|
1376 |
| - }); |
| 1376 | + }]); |
1377 | 1377 |
|
1378 | 1378 | }(this));
|
0 commit comments