@@ -252,7 +252,7 @@ angular.module('patternfly.card').directive('pfCard', function () {
252
252
* @param {expression } config the c3 configuration options for the chart
253
253
*
254
254
* @example
255
- <example module="patternfly.charts">
255
+ <example module="patternfly.charts">
256
256
<file name="index.html">
257
257
<div ng-controller="ChartCtrl">
258
258
<div pf-c3-chart id="chartId" config="chartConfig"></div>
@@ -269,7 +269,9 @@ angular.module('patternfly.card').directive('pfCard', function () {
269
269
</file>
270
270
271
271
<file name="script.js">
272
- function ChartCtrl($scope) {
272
+
273
+ angular.module( 'patternfly.charts' )
274
+ .controller( 'ChartCtrl', ['$scope', function( $scope ) {
273
275
$scope.used = 950;
274
276
$scope.total = 1000;
275
277
$scope.available = $scope.total - $scope.used;
@@ -302,7 +304,7 @@ angular.module('patternfly.card').directive('pfCard', function () {
302
304
$scope.updateAvailable();
303
305
$scope.chartConfig.data.columns = [["Used",$scope.used],["Available",$scope.available]];
304
306
};
305
- }
307
+ }]);
306
308
</file>
307
309
</example>
308
310
*/
@@ -458,8 +460,8 @@ angular.module('patternfly.card').directive('pfCard', function () {
458
460
</file>
459
461
460
462
<file name="script.js">
461
- function ChartCtrl($scope) {
462
-
463
+ angular.module( 'patternfly.charts' )
464
+ .controller( 'ChartCtrl', ['$scope', function( $scope ) {
463
465
$scope.config = {
464
466
'chartId': 'chartA',
465
467
'units': 'GB',
@@ -541,8 +543,7 @@ angular.module('patternfly.card').directive('pfCard', function () {
541
543
'used': '670',
542
544
'total': '1000'
543
545
};
544
-
545
- };
546
+ }]);
546
547
</file>
547
548
</example>
548
549
*/
@@ -811,7 +812,8 @@ angular.module('patternfly.charts').directive('pfDonutPctChart', ['c3ChartDefaul
811
812
</file>
812
813
813
814
<file name="script.js">
814
- function ChartCtrl($scope) {
815
+ angular.module( 'patternfly.charts' )
816
+ .controller( 'ChartCtrl', ['$scope', function( $scope ) {
815
817
816
818
$scope.config = {
817
819
'chartId': 'exampleSparkline',
@@ -838,7 +840,7 @@ angular.module('patternfly.charts').directive('pfDonutPctChart', ['c3ChartDefaul
838
840
$scope.data.xData.push(new Date($scope.data.xData[$scope.data.xData.length - 1].getTime() + (24 * 60 * 60 * 1000)));
839
841
$scope.data.yData.push(Math.round(Math.random() * 100));
840
842
};
841
- };
843
+ }]) ;
842
844
</file>
843
845
</example>
844
846
*/
@@ -1161,7 +1163,8 @@ angular.module('patternfly.charts').directive('pfSparklineChart', ['c3ChartDefau
1161
1163
</file>
1162
1164
1163
1165
<file name="script.js">
1164
- function ChartCtrl($scope) {
1166
+ angular.module( 'patternfly.charts' )
1167
+ .controller( 'ChartCtrl', ['$scope', function( $scope ) {
1165
1168
1166
1169
$scope.config = {
1167
1170
title: 'Memory',
@@ -1203,7 +1206,7 @@ angular.module('patternfly.charts').directive('pfSparklineChart', ['c3ChartDefau
1203
1206
$scope.data.xData.push(newDate);
1204
1207
$scope.data.yData.push(newData);
1205
1208
};
1206
- };
1209
+ }]) ;
1207
1210
</file>
1208
1211
</example>
1209
1212
*/
@@ -1280,7 +1283,9 @@ angular.module('patternfly.charts').directive('pfUtilizationChart',
1280
1283
</file>
1281
1284
1282
1285
<file name="script.js">
1283
- function FormDemoCtrl ($scope) {
1286
+
1287
+ angular.module( 'patternfly.form' )
1288
+ .controller( 'FormDemoCtrl', ['$scope', function( $scope ) {
1284
1289
$scope.setToday = function () {
1285
1290
$scope.date = new Date();
1286
1291
}
@@ -1290,7 +1295,7 @@ angular.module('patternfly.charts').directive('pfUtilizationChart',
1290
1295
todayBtn: 'linked',
1291
1296
todayHighlight: true
1292
1297
};
1293
- }
1298
+ }]);
1294
1299
</file>
1295
1300
</example>
1296
1301
*/
@@ -1363,7 +1368,8 @@ angular.module('patternfly.form').directive('pfDatepicker', function () {
1363
1368
</file>
1364
1369
1365
1370
<file name="script.js">
1366
- function FormButtonCtrl ($scope, $timeout) {
1371
+ angular.module( 'patternfly.form' )
1372
+ .controller( 'FormButtonCtrl', ['$scope', '$timeout', function( $scope, $timeout ) {
1367
1373
$scope.status = 'Not yet Saved'
1368
1374
$scope.working = false;
1369
1375
@@ -1380,7 +1386,7 @@ angular.module('patternfly.form').directive('pfDatepicker', function () {
1380
1386
$scope.status = 'cancelled';
1381
1387
$scope.input = null;
1382
1388
};
1383
- }
1389
+ }]);
1384
1390
</file>
1385
1391
</example>
1386
1392
*/
@@ -1455,12 +1461,13 @@ angular.module('patternfly.form').directive('pfFormButtons', function () {
1455
1461
</file>
1456
1462
1457
1463
<file name="script.js">
1458
- function FormDemoCtrl ($scope) {
1464
+ angular.module( 'patternfly.form' )
1465
+ .controller( 'FormDemoCtrl', ['$scope', function( $scope ) {
1459
1466
$scope.item = {
1460
1467
name: 'Homer Simpson',
1461
1468
description: 'I like donuts and Duff. Doh!'
1462
1469
};
1463
- }
1470
+ }]);
1464
1471
</file>
1465
1472
</example>
1466
1473
*/
@@ -1593,7 +1600,8 @@ angular.module('patternfly.form').directive('pfFormGroup', function () {
1593
1600
</file>
1594
1601
1595
1602
<file name="script.js">
1596
- function NotificationDemoCtrl($scope, Notifications) {
1603
+ angular.module( 'patternfly.notification' )
1604
+ .controller( 'NotificationDemoCtrl', ['$scope', 'Notifications', function( $scope, Notifications ) {
1597
1605
1598
1606
var typeMap = { 'Info': Notifications.info,
1599
1607
'Success': Notifications.success,
@@ -1608,7 +1616,7 @@ angular.module('patternfly.form').directive('pfFormGroup', function () {
1608
1616
$scope.notify = function () {
1609
1617
typeMap[$scope.type]($scope.message);
1610
1618
}
1611
- }
1619
+ }]);
1612
1620
</file>
1613
1621
1614
1622
</example>
@@ -1709,7 +1717,7 @@ angular.module('patternfly.notification', []).provider('Notifications', function
1709
1717
return notifications ;
1710
1718
} ] ;
1711
1719
1712
- } )
1720
+ } ) ;
1713
1721
1714
1722
/**
1715
1723
* @ngdoc directive
@@ -1767,19 +1775,21 @@ angular.module('patternfly.notification', []).provider('Notifications', function
1767
1775
</file>
1768
1776
1769
1777
<file name="script.js">
1770
- function NotificationDemoCtrl($scope) {
1778
+
1779
+ angular.module( 'patternfly.notification' )
1780
+ .controller( 'NotificationDemoCtrl', ['$scope', 'Notifications', function( $scope, Notifications ) {
1771
1781
$scope.types = ['success','info','danger', 'warning'];
1772
1782
$scope.type = $scope.types[0];
1773
1783
$scope.isPersistent = false;
1774
1784
1775
1785
$scope.header = 'Default Header.';
1776
1786
$scope.message = 'Default Message.';
1777
- }
1787
+ }]);
1778
1788
</file>
1779
1789
1780
1790
</example>
1781
1791
*/
1782
- . directive ( 'pfNotification' , function ( ) {
1792
+ angular . module ( 'patternfly.notification' ) . directive ( 'pfNotification' , function ( ) {
1783
1793
'use strict' ;
1784
1794
1785
1795
return {
@@ -1793,7 +1803,7 @@ angular.module('patternfly.notification', []).provider('Notifications', function
1793
1803
restrict : 'E' ,
1794
1804
templateUrl : 'notification/notification.html'
1795
1805
} ;
1796
- } )
1806
+ } ) ;
1797
1807
/**
1798
1808
* @ngdoc directive
1799
1809
* @name patternfly.notification:pfNotificationList
@@ -1833,8 +1843,8 @@ angular.module('patternfly.notification', []).provider('Notifications', function
1833
1843
</file>
1834
1844
1835
1845
<file name="script.js">
1836
- function NotificationDemoCtrl($scope, Notifications) {
1837
-
1846
+ angular.module( 'patternfly.notification' )
1847
+ .controller( 'NotificationDemoCtrl', ['$scope', 'Notifications', function( $scope, Notifications ) {
1838
1848
$scope.message = 'Default Message.';
1839
1849
1840
1850
var typeMap = { 'Info': Notifications.info,
@@ -1850,12 +1860,12 @@ angular.module('patternfly.notification', []).provider('Notifications', function
1850
1860
$scope.notify = function () {
1851
1861
typeMap[$scope.type]($scope.message);
1852
1862
}
1853
- }
1863
+ }]);
1854
1864
</file>
1855
1865
1856
1866
</example>
1857
1867
*/
1858
- . directive ( 'pfNotificationList' , function ( ) {
1868
+ angular . module ( 'patternfly.notification' ) . directive ( 'pfNotificationList' , function ( ) {
1859
1869
'use strict' ;
1860
1870
1861
1871
return {
@@ -1918,11 +1928,12 @@ angular.module('patternfly.notification', []).provider('Notifications', function
1918
1928
</file>
1919
1929
1920
1930
<file name="script.js">
1921
- function SelectDemoCtrl($scope) {
1931
+ angular.module( 'patternfly.select' )
1932
+ .controller( 'SelectDemoCtrl', ['$scope', function( $scope ) {
1922
1933
$scope.drinks = ['tea', 'coffee', 'water'];
1923
1934
$scope.pets = ['Dog', 'Cat', 'Chicken'];
1924
1935
$scope.pet = $scope.pets[0];
1925
- }
1936
+ }]);
1926
1937
</file>
1927
1938
1928
1939
</example>
@@ -2017,7 +2028,8 @@ angular.module('patternfly.select', []).directive('pfSelect', function ($timeout
2017
2028
</file>
2018
2029
2019
2030
<file name="script.js">
2020
- function ValidationDemoCtrl($scope) {
2031
+ angular.module( 'patternfly.validation' )
2032
+ .controller( 'ValidationDemoCtrl', ['$scope', function( $scope ) {
2021
2033
$scope.myValue = "Change this value to be a number";
2022
2034
$scope.myValueValid = 42;
2023
2035
$scope.isValidationDisabled = false;
@@ -2029,7 +2041,7 @@ angular.module('patternfly.select', []).directive('pfSelect', function ($timeout
2029
2041
2030
2042
return true;
2031
2043
}
2032
- }
2044
+ }]);
2033
2045
</file>
2034
2046
2035
2047
</example>
@@ -2183,7 +2195,7 @@ angular.module('patternfly.validation', []).directive('pfValidation', function (
2183
2195
2184
2196
2185
2197
$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>"
2187
2199
) ;
2188
2200
2189
2201
} ] ) ;
0 commit comments