From 5a835f8c397b3aa8f9b6edd073d681d56f6a1e6e Mon Sep 17 00:00:00 2001 From: Gustavo Martin Morcuende Date: Sun, 13 Sep 2015 20:22:58 +0200 Subject: [PATCH] showcase: change bower.json dependencies order 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 | 8 +-- angularjs/showcase/karma.conf.js | 6 +- .../app/widgets/example-child.directive.js | 65 ++++++++++++++++++++++ angularjs/showcase/src/showcase/index.html | 8 ++- 4 files changed, 77 insertions(+), 10 deletions(-) create mode 100644 angularjs/showcase/src/showcase/app/widgets/example-child.directive.js diff --git a/angularjs/showcase/bower.json b/angularjs/showcase/bower.json index 1d092f5..ce4f21c 100644 --- a/angularjs/showcase/bower.json +++ b/angularjs/showcase/bower.json @@ -16,13 +16,13 @@ "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" diff --git a/angularjs/showcase/karma.conf.js b/angularjs/showcase/karma.conf.js index 9866ad6..7049cff 100644 --- a/angularjs/showcase/karma.conf.js +++ b/angularjs/showcase/karma.conf.js @@ -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 index 0000000..6d65816 --- /dev/null +++ b/angularjs/showcase/src/showcase/app/widgets/example-child.directive.js @@ -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 + * + *

+ *
+ * {@link https://docs.angularjs.org/api/ng/type/$rootScope.Scope $scope} + *

+ * + * @description + * Controller directive example. + * + * @element parent-directive + * + * @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; + } + +})(); diff --git a/angularjs/showcase/src/showcase/index.html b/angularjs/showcase/src/showcase/index.html index 2c75fae..8eeeb35 100644 --- a/angularjs/showcase/src/showcase/index.html +++ b/angularjs/showcase/src/showcase/index.html @@ -37,13 +37,13 @@ + + + - - - @@ -52,8 +52,10 @@ + + -- 2.1.4