diff --git a/ng1-hosting-ng2/.bowerrc b/ng1-hosting-ng2/.bowerrc new file mode 100644 index 0000000000..8c58c8efc9 --- /dev/null +++ b/ng1-hosting-ng2/.bowerrc @@ -0,0 +1,3 @@ +{ + "directory": "app/bower_components" +} \ No newline at end of file diff --git a/ng1-hosting-ng2/.gitignore b/ng1-hosting-ng2/.gitignore new file mode 100644 index 0000000000..08f3db8518 --- /dev/null +++ b/ng1-hosting-ng2/.gitignore @@ -0,0 +1,8 @@ +logs/* +!.gitkeep +typings/ +node_modules/ +bower_components/ +tmp +.DS_Store +.idea diff --git a/ng1-hosting-ng2/.jshintrc b/ng1-hosting-ng2/.jshintrc new file mode 100644 index 0000000000..6f00218e37 --- /dev/null +++ b/ng1-hosting-ng2/.jshintrc @@ -0,0 +1,13 @@ +{ + "globalstrict": true, + "globals": { + "angular": false, + "describe": false, + "it": false, + "expect": false, + "beforeEach": false, + "afterEach": false, + "module": false, + "inject": false + } +} \ No newline at end of file diff --git a/ng1-hosting-ng2/.travis.yml b/ng1-hosting-ng2/.travis.yml new file mode 100644 index 0000000000..cce5c682a8 --- /dev/null +++ b/ng1-hosting-ng2/.travis.yml @@ -0,0 +1,14 @@ +language: node_js +node_js: + - "0.10" + +before_script: + - export DISPLAY=:99.0 + - sh -e /etc/init.d/xvfb start + - npm start > /dev/null & + - npm run update-webdriver + - sleep 1 # give server time to start + +script: + - node_modules/.bin/karma start karma.conf.js --no-auto-watch --single-run --reporters=dots --browsers=Firefox + - node_modules/.bin/protractor e2e-tests/protractor.conf.js --browser=firefox diff --git a/ng1-hosting-ng2/LICENSE b/ng1-hosting-ng2/LICENSE new file mode 100644 index 0000000000..8ae3a9877e --- /dev/null +++ b/ng1-hosting-ng2/LICENSE @@ -0,0 +1,22 @@ +The MIT License + +Copyright (c) 2016 Alfresco + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + diff --git a/ng1-hosting-ng2/README.md b/ng1-hosting-ng2/README.md new file mode 100644 index 0000000000..54aef80d99 --- /dev/null +++ b/ng1-hosting-ng2/README.md @@ -0,0 +1,32 @@ +### Install Dependencies + +We have two kinds of dependencies in this project: tools and angular framework code. The tools help +us manage and test the application. + +* We get the tools we depend upon via `npm`, the [node package manager][npm]. +* We get the angular code via `bower`, a [client-side code package manager][bower]. + +We have preconfigured `npm` to automatically run `bower` so we can simply do: + +``` +npm install +``` + +Behind the scenes this will also call `bower install`. You should find that you have two new +folders in your project. + +* `node_modules` - contains the npm packages for the tools we need +* `app/bower_components` - contains the angular framework files + +*Note that the `bower_components` folder would normally be installed in the root folder but +angular-seed changes this location through the `.bowerrc` file. Putting it in the app folder makes +it easier to serve the files by a webserver.* + +### Run the Application + +We have preconfigured the project with a simple development web server. The simplest way to start +this server is: + +``` +npm start +``` diff --git a/ng1-hosting-ng2/app/app.component.js b/ng1-hosting-ng2/app/app.component.js new file mode 100644 index 0000000000..3070b348a0 --- /dev/null +++ b/ng1-hosting-ng2/app/app.component.js @@ -0,0 +1,41 @@ +System.register(['angular2/core', "./components/ng2/tabs"], function(exports_1, context_1) { + "use strict"; + var __moduleName = context_1 && context_1.id; + var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); + }; + var core_1, tabs_1; + var AppComponent; + return { + setters:[ + function (core_1_1) { + core_1 = core_1_1; + }, + function (tabs_1_1) { + tabs_1 = tabs_1_1; + }], + execute: function() { + AppComponent = (function () { + function AppComponent() { + } + AppComponent = __decorate([ + core_1.Component({ + selector: 'my-app', + template: "\n
This is the partial for view 1.
+ +This is the partial for view 2.
++ Showing of 'interpolate' filter: + {{ 'Current version is v%VERSION%.' | interpolate }} +
diff --git a/ng1-hosting-ng2/app/view2/view2.js b/ng1-hosting-ng2/app/view2/view2.js new file mode 100644 index 0000000000..2eac14fd0d --- /dev/null +++ b/ng1-hosting-ng2/app/view2/view2.js @@ -0,0 +1,14 @@ +'use strict'; + +angular.module('myApp.view2', ['ngRoute']) + +.config(['$routeProvider', function($routeProvider) { + $routeProvider.when('/view2', { + templateUrl: 'app/view2/view2.html', + controller: 'View2Ctrl' + }); +}]) + +.controller('View2Ctrl', [function() { + +}]); diff --git a/ng1-hosting-ng2/app/view2/view2_test.js b/ng1-hosting-ng2/app/view2/view2_test.js new file mode 100644 index 0000000000..07b34d6bb3 --- /dev/null +++ b/ng1-hosting-ng2/app/view2/view2_test.js @@ -0,0 +1,16 @@ +'use strict'; + +describe('myApp.view2 module', function() { + + beforeEach(module('myApp.view2')); + + describe('view2 controller', function(){ + + it('should ....', inject(function($controller) { + //spec body + var view2Ctrl = $controller('View2Ctrl'); + expect(view2Ctrl).toBeDefined(); + })); + + }); +}); \ No newline at end of file diff --git a/ng1-hosting-ng2/app/view3/view3.html b/ng1-hosting-ng2/app/view3/view3.html new file mode 100644 index 0000000000..12f4dda25c --- /dev/null +++ b/ng1-hosting-ng2/app/view3/view3.html @@ -0,0 +1,4 @@ +This is the partial for view 3 (ng1)
+ +