showcase: change bower.json dependencies order
authorGustavo Martin Morcuende <gu.martinm@gmail.com>
Sun, 13 Sep 2015 18:22:58 +0000 (20:22 +0200)
committerGustavo Martin Morcuende <gu.martinm@gmail.com>
Sun, 13 Sep 2015 18:22:58 +0000 (20:22 +0200)
wiredep fills index.html following the dependencies order in bower.json and we
want jquery being declared before angular.js in index.html file

angularjs/showcase/bower.json
angularjs/showcase/karma.conf.js
angularjs/showcase/src/showcase/app/widgets/example-child.directive.js [new file with mode: 0644]
angularjs/showcase/src/showcase/index.html

index 1d092f5..ce4f21c 100644 (file)
     "server.js"
   ],
   "dependencies": {
-    "angular": "~1.4.5",
+    "bootstrap": "~4.0.0-alpha",
+    "font-awesome": "~4.4.0",
+    "oclazyload": "~1.0.5",
     "angular-bootstrap": "~0.13.4",
     "angular-translate": "~2.7.2",
     "angular-ui-router": "~0.2.15",
-    "oclazyload": "~1.0.5",
-    "bootstrap": "~4.0.0-alpha",
-    "font-awesome": "~4.4.0"
+    "angular": "~1.4.5"
   },
   "devDependencies": {
     "angular-mocks": "~1.4.5"
index 9866ad6..7049cff 100644 (file)
@@ -22,13 +22,13 @@ module.exports = function(config) {
     // list of files / patterns to load in the browser
     files: [
       //bower:js
+      'bower_components/jquery/dist/jquery.js',
+      'bower_components/bootstrap/dist/js/bootstrap.js',
       'bower_components/angular/angular.js',
+      'bower_components/oclazyload/dist/ocLazyLoad.js',
       'bower_components/angular-bootstrap/ui-bootstrap-tpls.js',
       'bower_components/angular-translate/angular-translate.js',
       'bower_components/angular-ui-router/release/angular-ui-router.js',
-      'bower_components/oclazyload/dist/ocLazyLoad.js',
-      'bower_components/jquery/dist/jquery.js',
-      'bower_components/bootstrap/dist/js/bootstrap.js',
       'bower_components/angular-mocks/angular-mocks.js',
       //endbower
       'src/showcase/app/**/*.module.js',
diff --git a/angularjs/showcase/src/showcase/app/widgets/example-child.directive.js b/angularjs/showcase/src/showcase/app/widgets/example-child.directive.js
new file mode 100644 (file)
index 0000000..6d65816
--- /dev/null
@@ -0,0 +1,65 @@
+(function () {
+  'use strict';
+
+  angular
+    .module('app.widgets')
+    .directive('parentDirective', parentDirective);
+
+  /**
+   * @ngdoc directive
+   * @name app.widgets.directive:parentDirective
+   * @restrict EA
+   * @requires $scope
+   *
+   * <p>
+   * <br>
+   * {@link https://docs.angularjs.org/api/ng/type/$rootScope.Scope $scope}
+   * </p>
+   *
+   * @description
+   * Controller directive example.
+   *
+   * @element parent-directive
+   *
+   * @example
+    <example name="controller-directive" module="app.widgets">
+      <file name="index.html">
+        <parent-directive>
+      </file>
+    </example>
+   */
+  function parentDirective() {
+    return {
+      restrict: 'EA',
+      templateUrl: 'app/widgets/example-parent.directive.html',
+      link: linkFunc,
+      compile: function compile(element, attributes, transcludeFn) {
+        console.log('PARENT-DIRECTIVE: compile');
+        return {
+          pre: function preLink(scope, element, attributes, controller, transcludeFn) {
+            console.log('PARENT-DIRECTIVE: preLink');
+          },
+          post: function postLink(scope, element, attributes, controller, transcludeFn) {
+            console.log('PARENT-DIRECTIVE: postLink');
+          }
+        };
+      },
+      controller: ExampleParentController,
+      scope: {
+        max: '='
+      }
+    };
+
+    function linkFunc(scope, el, attr, ctrl) {
+      console.log('PARENT-DIRECTIVE: linkFunc');
+    }
+  }
+
+  /* @ngInject */
+  function ExampleParentController($scope) {
+    console.log('PARENT-DIRECTIVE: controller');
+
+    $scope.min = 3;
+  }
+
+})();
index 2c75fae..8eeeb35 100644 (file)
     <!-- Vendor JavaScript -->
     <!-- build:js(.) js/lib.min.js -->
     <!-- bower:js -->
+    <script src="/bower_components/jquery/dist/jquery.js"></script>
+    <script src="/bower_components/bootstrap/dist/js/bootstrap.js"></script>
     <script src="/bower_components/angular/angular.js"></script>
+    <script src="/bower_components/oclazyload/dist/ocLazyLoad.js"></script>
     <script src="/bower_components/angular-bootstrap/ui-bootstrap-tpls.js"></script>
     <script src="/bower_components/angular-translate/angular-translate.js"></script>
     <script src="/bower_components/angular-ui-router/release/angular-ui-router.js"></script>
-    <script src="/bower_components/oclazyload/dist/ocLazyLoad.js"></script>
-    <script src="/bower_components/jquery/dist/jquery.js"></script>
-    <script src="/bower_components/bootstrap/dist/js/bootstrap.js"></script>
     <!-- endbower -->
     <!-- endbuild -->
 
     <!-- build:js(.) js/app.min.js -->
     <!-- inject:js -->
     <script src="/src/showcase/app/widgets/widgets.module.js"></script>
+    <script src="/src/showcase/app/widgets/example-parent.directive.js"></script>
     <script src="/src/showcase/app/widgets/example-controller.directive.js"></script>
     <script src="/src/showcase/app/widgets/example-controller-as.directive.js"></script>
+    <script src="/src/showcase/app/widgets/example-child.directive.js"></script>
     <script src="/src/showcase/app/welcome/welcome.module.js"></script>
     <script src="/src/showcase/app/welcome/welcome.route.js"></script>
     <script src="/src/showcase/app/welcome/welcome.controller.js"></script>