@@ -252,7 +252,7 @@ angular.module('patternfly.card').directive('pfCard', function () {
252252 * @param {expression } config the c3 configuration options for the chart
253253 *
254254 * @example
255- <example module="patternfly.charts">
255+ <example module="patternfly.charts">
256256<file name="index.html">
257257 <div ng-controller="ChartCtrl">
258258 <div pf-c3-chart id="chartId" config="chartConfig"></div>
@@ -269,7 +269,9 @@ angular.module('patternfly.card').directive('pfCard', function () {
269269 </file>
270270
271271<file name="script.js">
272- function ChartCtrl($scope) {
272+
273+ angular.module( 'patternfly.charts' )
274+ .controller( 'ChartCtrl', ['$scope', function( $scope ) {
273275 $scope.used = 950;
274276 $scope.total = 1000;
275277 $scope.available = $scope.total - $scope.used;
@@ -302,7 +304,7 @@ angular.module('patternfly.card').directive('pfCard', function () {
302304 $scope.updateAvailable();
303305 $scope.chartConfig.data.columns = [["Used",$scope.used],["Available",$scope.available]];
304306 };
305- }
307+ }]);
306308 </file>
307309 </example>
308310 */
@@ -458,8 +460,8 @@ angular.module('patternfly.card').directive('pfCard', function () {
458460</file>
459461
460462<file name="script.js">
461- function ChartCtrl($scope) {
462-
463+ angular.module( 'patternfly.charts' )
464+ .controller( 'ChartCtrl', ['$scope', function( $scope ) {
463465 $scope.config = {
464466 'chartId': 'chartA',
465467 'units': 'GB',
@@ -541,8 +543,7 @@ angular.module('patternfly.card').directive('pfCard', function () {
541543 'used': '670',
542544 'total': '1000'
543545 };
544-
545- };
546+ }]);
546547 </file>
547548 </example>
548549 */
@@ -811,7 +812,8 @@ angular.module('patternfly.charts').directive('pfDonutPctChart', ['c3ChartDefaul
811812 </file>
812813
813814 <file name="script.js">
814- function ChartCtrl($scope) {
815+ angular.module( 'patternfly.charts' )
816+ .controller( 'ChartCtrl', ['$scope', function( $scope ) {
815817
816818 $scope.config = {
817819 'chartId': 'exampleSparkline',
@@ -838,7 +840,7 @@ angular.module('patternfly.charts').directive('pfDonutPctChart', ['c3ChartDefaul
838840 $scope.data.xData.push(new Date($scope.data.xData[$scope.data.xData.length - 1].getTime() + (24 * 60 * 60 * 1000)));
839841 $scope.data.yData.push(Math.round(Math.random() * 100));
840842 };
841- };
843+ }]) ;
842844 </file>
843845 </example>
844846 */
@@ -1161,7 +1163,8 @@ angular.module('patternfly.charts').directive('pfSparklineChart', ['c3ChartDefau
11611163 </file>
11621164
11631165 <file name="script.js">
1164- function ChartCtrl($scope) {
1166+ angular.module( 'patternfly.charts' )
1167+ .controller( 'ChartCtrl', ['$scope', function( $scope ) {
11651168
11661169 $scope.config = {
11671170 title: 'Memory',
@@ -1203,7 +1206,7 @@ angular.module('patternfly.charts').directive('pfSparklineChart', ['c3ChartDefau
12031206 $scope.data.xData.push(newDate);
12041207 $scope.data.yData.push(newData);
12051208 };
1206- };
1209+ }]) ;
12071210 </file>
12081211 </example>
12091212 */
@@ -1280,7 +1283,9 @@ angular.module('patternfly.charts').directive('pfUtilizationChart',
12801283 </file>
12811284
12821285 <file name="script.js">
1283- function FormDemoCtrl ($scope) {
1286+
1287+ angular.module( 'patternfly.form' )
1288+ .controller( 'FormDemoCtrl', ['$scope', function( $scope ) {
12841289 $scope.setToday = function () {
12851290 $scope.date = new Date();
12861291 }
@@ -1290,7 +1295,7 @@ angular.module('patternfly.charts').directive('pfUtilizationChart',
12901295 todayBtn: 'linked',
12911296 todayHighlight: true
12921297 };
1293- }
1298+ }]);
12941299 </file>
12951300 </example>
12961301 */
@@ -1363,7 +1368,8 @@ angular.module('patternfly.form').directive('pfDatepicker', function () {
13631368 </file>
13641369
13651370 <file name="script.js">
1366- function FormButtonCtrl ($scope, $timeout) {
1371+ angular.module( 'patternfly.form' )
1372+ .controller( 'FormButtonCtrl', ['$scope', '$timeout', function( $scope, $timeout ) {
13671373 $scope.status = 'Not yet Saved'
13681374 $scope.working = false;
13691375
@@ -1380,7 +1386,7 @@ angular.module('patternfly.form').directive('pfDatepicker', function () {
13801386 $scope.status = 'cancelled';
13811387 $scope.input = null;
13821388 };
1383- }
1389+ }]);
13841390 </file>
13851391 </example>
13861392 */
@@ -1455,12 +1461,13 @@ angular.module('patternfly.form').directive('pfFormButtons', function () {
14551461 </file>
14561462
14571463 <file name="script.js">
1458- function FormDemoCtrl ($scope) {
1464+ angular.module( 'patternfly.form' )
1465+ .controller( 'FormDemoCtrl', ['$scope', function( $scope ) {
14591466 $scope.item = {
14601467 name: 'Homer Simpson',
14611468 description: 'I like donuts and Duff. Doh!'
14621469 };
1463- }
1470+ }]);
14641471 </file>
14651472 </example>
14661473 */
@@ -1593,7 +1600,8 @@ angular.module('patternfly.form').directive('pfFormGroup', function () {
15931600 </file>
15941601
15951602 <file name="script.js">
1596- function NotificationDemoCtrl($scope, Notifications) {
1603+ angular.module( 'patternfly.notification' )
1604+ .controller( 'NotificationDemoCtrl', ['$scope', 'Notifications', function( $scope, Notifications ) {
15971605
15981606 var typeMap = { 'Info': Notifications.info,
15991607 'Success': Notifications.success,
@@ -1608,7 +1616,7 @@ angular.module('patternfly.form').directive('pfFormGroup', function () {
16081616 $scope.notify = function () {
16091617 typeMap[$scope.type]($scope.message);
16101618 }
1611- }
1619+ }]);
16121620 </file>
16131621
16141622 </example>
@@ -1709,7 +1717,7 @@ angular.module('patternfly.notification', []).provider('Notifications', function
17091717 return notifications ;
17101718 } ] ;
17111719
1712- } )
1720+ } ) ;
17131721
17141722/**
17151723 * @ngdoc directive
@@ -1767,19 +1775,21 @@ angular.module('patternfly.notification', []).provider('Notifications', function
17671775 </file>
17681776
17691777 <file name="script.js">
1770- function NotificationDemoCtrl($scope) {
1778+
1779+ angular.module( 'patternfly.notification' )
1780+ .controller( 'NotificationDemoCtrl', ['$scope', 'Notifications', function( $scope, Notifications ) {
17711781 $scope.types = ['success','info','danger', 'warning'];
17721782 $scope.type = $scope.types[0];
17731783 $scope.isPersistent = false;
17741784
17751785 $scope.header = 'Default Header.';
17761786 $scope.message = 'Default Message.';
1777- }
1787+ }]);
17781788 </file>
17791789
17801790 </example>
17811791 */
1782- . directive ( 'pfNotification' , function ( ) {
1792+ angular . module ( 'patternfly.notification' ) . directive ( 'pfNotification' , function ( ) {
17831793 'use strict' ;
17841794
17851795 return {
@@ -1793,7 +1803,7 @@ angular.module('patternfly.notification', []).provider('Notifications', function
17931803 restrict : 'E' ,
17941804 templateUrl : 'notification/notification.html'
17951805 } ;
1796- } )
1806+ } ) ;
17971807/**
17981808 * @ngdoc directive
17991809 * @name patternfly.notification:pfNotificationList
@@ -1833,8 +1843,8 @@ angular.module('patternfly.notification', []).provider('Notifications', function
18331843 </file>
18341844
18351845 <file name="script.js">
1836- function NotificationDemoCtrl($scope, Notifications) {
1837-
1846+ angular.module( 'patternfly.notification' )
1847+ .controller( 'NotificationDemoCtrl', ['$scope', 'Notifications', function( $scope, Notifications ) {
18381848 $scope.message = 'Default Message.';
18391849
18401850 var typeMap = { 'Info': Notifications.info,
@@ -1850,12 +1860,12 @@ angular.module('patternfly.notification', []).provider('Notifications', function
18501860 $scope.notify = function () {
18511861 typeMap[$scope.type]($scope.message);
18521862 }
1853- }
1863+ }]);
18541864 </file>
18551865
18561866 </example>
18571867 */
1858- . directive ( 'pfNotificationList' , function ( ) {
1868+ angular . module ( 'patternfly.notification' ) . directive ( 'pfNotificationList' , function ( ) {
18591869 'use strict' ;
18601870
18611871 return {
@@ -1918,11 +1928,12 @@ angular.module('patternfly.notification', []).provider('Notifications', function
19181928 </file>
19191929
19201930 <file name="script.js">
1921- function SelectDemoCtrl($scope) {
1931+ angular.module( 'patternfly.select' )
1932+ .controller( 'SelectDemoCtrl', ['$scope', function( $scope ) {
19221933 $scope.drinks = ['tea', 'coffee', 'water'];
19231934 $scope.pets = ['Dog', 'Cat', 'Chicken'];
19241935 $scope.pet = $scope.pets[0];
1925- }
1936+ }]);
19261937 </file>
19271938
19281939 </example>
@@ -2017,7 +2028,8 @@ angular.module('patternfly.select', []).directive('pfSelect', function ($timeout
20172028 </file>
20182029
20192030 <file name="script.js">
2020- function ValidationDemoCtrl($scope) {
2031+ angular.module( 'patternfly.validation' )
2032+ .controller( 'ValidationDemoCtrl', ['$scope', function( $scope ) {
20212033 $scope.myValue = "Change this value to be a number";
20222034 $scope.myValueValid = 42;
20232035 $scope.isValidationDisabled = false;
@@ -2029,7 +2041,7 @@ angular.module('patternfly.select', []).directive('pfSelect', function ($timeout
20292041
20302042 return true;
20312043 }
2032- }
2044+ }]);
20332045 </file>
20342046
20352047 </example>
@@ -2183,7 +2195,7 @@ angular.module('patternfly.validation', []).directive('pfValidation', function (
21832195
21842196
21852197 $templateCache . put ( 'notification/notification.html' ,
2186- "<div class=\"alert alert-{{pfNotificationType}}\"><button ng-show=pfNotificationPersistent type=button class=close ng-click=$parent.notifications.remove($index)><span aria-hidden=true>×</span><span class=sr-only>Close</span></button> <span class=\"pficon pficon-ok\" ng-show=\"pfNotificationType == 'success'\"></span> <span class=\"pficon pficon-info\" ng-show=\"pfNotificationType == 'info'\"></span> <span class=pficon-layered ng-show=\"pfNotificationType == 'danger'\"><span class=\"pficon pficon-error-octagon\">< /span> <span class=\"pficon pficon-error-exclamation\"></span></span> <span class=pficon-layered ng-show=\"pfNotificationType == 'warning'\"><span class=\"pficon pficon-warning-triangle\"></span> <span class=\"pficon pficon-warning-exclamation\"></span ></span> <strong>{{pfNotificationHeader}}</strong> {{pfNotificationMessage}}</div>"
2198+ "<div class=\"alert alert-{{pfNotificationType}}\"><button ng-show=pfNotificationPersistent type=button class=close ng-click=$parent.notifications.remove($index)><span aria-hidden=true>×</span><span class=sr-only>Close</span></button> <span class=\"pficon pficon-ok\" ng-show=\"pfNotificationType === 'success'\"></span> <span class=\"pficon pficon-info\" ng-show=\"pfNotificationType === 'info'\"></span> <span class=\" pficon pficon-error-circle-o\" ng-show=\"pfNotificationType === 'danger'\"></span> <span class=\"pficon pficon-warning-triangle-o\" ng-show=\"pfNotificationType === 'warning'\"></span> <strong>{{pfNotificationHeader}}</strong> {{pfNotificationMessage}}</div>"
21872199 ) ;
21882200
21892201} ] ) ;
0 commit comments