├── .bowerrc
├── .editorconfig
├── .gitignore
├── .jshintrc
├── .yo-rc.json
├── History.md
├── LICENSE
├── README.md
├── bower.json
├── dist
├── angular-ux.js
└── angular-ux.min.js
├── example
├── README.md
├── app.css
├── app.js
├── details.html
├── home.html
└── index.html
├── gulpfile.js
├── karma-dist-concatenated.conf.js
├── karma-dist-minified.conf.js
├── karma-src.conf.js
├── package.json
├── src
├── angularUx.js
├── angularUx.prefix
├── angularUx.suffix
└── modules
│ ├── global.js
│ ├── pages.js
│ └── theme.js
└── test
└── unit
└── angularUx
└── angularUxSpec.js
/.bowerrc:
--------------------------------------------------------------------------------
1 | {
2 | "directory": "bower"
3 | }
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # http://editorconfig.org
2 | root = true
3 |
4 | [*]
5 | indent_style = space
6 | indent_size = 2
7 | charset = utf-8
8 | trim_trailing_whitespace = true
9 | insert_final_newline = true
10 |
11 | [*.md]
12 | trim_trailing_whitespace = false
13 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ._*
2 | .~lock.*
3 | .buildpath
4 | .DS_Store
5 | .idea
6 | .project
7 | .settings
8 |
9 | # Ignore node stuff
10 | node_modules/
11 | npm-debug.log
12 | libpeerconnection.log
13 |
14 | # OS-specific
15 | .DS_Store
16 |
17 | # Bower components
18 | bower
19 |
--------------------------------------------------------------------------------
/.jshintrc:
--------------------------------------------------------------------------------
1 | {
2 | "node": true,
3 | "esnext": true,
4 | "bitwise": true,
5 | "curly": true,
6 | "eqeqeq": true,
7 | "immed": true,
8 | "indent": 2,
9 | "latedef": true,
10 | "newcap": true,
11 | "noarg": true,
12 | "quotmark": "single",
13 | "regexp": true,
14 | "undef": true,
15 | "strict": false,
16 | "smarttabs": true,
17 | "expr": true,
18 |
19 |
20 | "evil": true,
21 | "browser": true,
22 | "regexdash": true,
23 | "wsh": true,
24 | "trailing": true,
25 | "sub": true,
26 | "unused": true,
27 | "laxcomma": true,
28 |
29 | "globals": {
30 | "after": false,
31 | "before": false,
32 | "afterEach": false,
33 | "beforeEach": false,
34 | "describe": false,
35 | "it": false,
36 | "angular": false,
37 | "expect": false,
38 | "inject": false,
39 | "module": false,
40 | "sinon": false,
41 | "browser": false,
42 | "element": false,
43 | "by": false,
44 | "xit": false
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/.yo-rc.json:
--------------------------------------------------------------------------------
1 | {
2 | "generator-angularjs-gulp-library": {
3 | "props": {
4 | "author": {
5 | "name": "Martin Gontovnikas",
6 | "email": "martin@gon.to"
7 | },
8 | "libraryName": {
9 | "original": "angular-ux",
10 | "camelized": "angularUx",
11 | "dasherized": "angular-ux",
12 | "slugified": "angular-ux",
13 | "parts": [
14 | "angular",
15 | "ux"
16 | ]
17 | },
18 | "includeModuleDirectives": false,
19 | "includeModuleFilters": false,
20 | "includeModuleServices": false,
21 | "includeAngularModuleResource": false,
22 | "includeAngularModuleCookies": false,
23 | "includeAngularModuleSanitize": false,
24 | "librarySrcDirectory": "src/angularUx",
25 | "libraryUnitTestDirectory": "test/unit/angularUx",
26 | "libraryUnitE2eDirectory": "test/e2e/angularUx"
27 | }
28 | }
29 | }
--------------------------------------------------------------------------------
/History.md:
--------------------------------------------------------------------------------
1 |
2 | 0.0.2 / 2015-03-18
3 | ==================
4 |
5 | * Fixed bug with theming query param
6 | * Fixing HTML
7 |
8 | 0.0.1 / 2015-03-18
9 | ==================
10 |
11 | * Added README
12 | * Added build
13 | * Changing URL on ux-go
14 | * New version
15 | * Added example app
16 | * Created UX module
17 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2015 Martin Gontovnikas
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining
4 | a copy of this software and associated documentation files (the
5 | "Software"), to deal in the Software without restriction, including
6 | without limitation the rights to use, copy, modify, merge, publish,
7 | distribute, sublicense, and/or sell copies of the Software, and to
8 | permit persons to whom the Software is furnished to do so, subject to
9 | the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be
12 | included in all copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # angular-ux
2 |
3 | Angular UX is a library that helps you create live, navigable prototypes with the help of AngularJS but without having to learn how to code ;). **DESIGNERS, I'm looking at you!**
4 |
5 | ## Key features
6 |
7 | * Helps you create **live, navigable prototypes**
8 | * It's **intended for designers**, not coders
9 | * **No need to code** a single line of JS.
10 |
11 | ## Installing it
12 |
13 | You have several options:
14 |
15 | ````bash
16 | bower install angular-ux
17 | ````
18 |
19 | ````bash
20 | npm install angular-ux
21 | ````
22 |
23 | ````html
24 |
25 | ````
26 |
27 | ## Configuring it
28 |
29 | ### Setting up our prototype app
30 | The first thing we need to do is setup a new `index.html` which will be the point of entry for our app.
31 | Besides linking to the specific CSS and JS files we need for our prototype, we always need to reference `jQuery`, `angular.js`, `angular-animate` and `angular-ux` in that order.
32 |
33 | > We also need some way of serving the directory where the `index.html` and the other files will reside. For that, we can use `npm` command `serve` or `python -M SimpleHTTPServer`
34 |
35 | ### Setting up the Angular application
36 |
37 | Now, we need to setup the Angular application. This will be the only javascript we need to code to have our prototype running. The good thing is that it’s just copy and paste ;).
38 |
39 | ```html
40 |
41 |
42 | ```
43 |
44 | ```js
45 | // app.js
46 | angular.module(‘prototype’, [‘ngAnimate’, ‘ux’])
47 | .controller(‘MainCtrl’, function($scope) {
48 | $scope.data = {};
49 | });
50 | ```
51 |
52 | ## Usage / Features
53 |
54 | ### Navigating through different pages
55 | The first thing all prototypes need is the ability to navigate through different pages.
56 | For this, we can use the `ux-page` directive.
57 |
58 | ```html
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 | ```
68 | ```html
69 |
70 |
71 | Go to Details page
72 | ```
73 |
74 | In this case, we’re creating 2 different pages. The content of each of those pages are in separate files which we’re including using the `ng-include` directive. Note that we added the `home` attribute to the `ux-page` that will be the main one (displayed by default).
75 |
76 | Then, in the `home.html`, we have a link that navigates the user to the `Details` page. For that, we’re using the `ux-go` directive with the name of the page that we want to browse to.
77 |
78 | > **Note**: It’s important to note that you must put the `href=“”` in the link so that it’s clickable.
79 |
80 | ### Theming
81 |
82 | When you’re prototyping you want to try different themes (colors, typographies, sizes, etc.) at the same time to see which one works better.
83 | For that, you can use a the `ux-themeable` feature from `angular-ux`:
84 |
85 | ```html
86 |
87 |
Title
88 |
This is some text
89 |
90 | ```
91 |
92 | First you need to add the `ux-themeable` directive to the parent HTML element that you want to theme. Then, to change themes, you need to specify the theme name as a query parameter in the prototype URL. For example, if you go to `http://localhost:3000/#/?page=Details&uxTheme=option1`, the `div.content` will end up having an additional class named `option1` which means we can style it as follows:
93 |
94 | ```css
95 | div.content.option1 h1 {
96 | font-size: 38px;
97 | }
98 |
99 | div.content.option1 p {
100 | color: red
101 | }
102 | ```
103 |
104 | Alternatively, you can set the query parameter to use for this `ux-themeable` as follows:
105 |
106 | ```html
107 |
108 |
Title
109 |
This is some text
110 |
111 | ```
112 |
113 | Then, the URL to add `option1` class to `div.content` would be `http://localhost:3000/#/?page=Details&ucontentTheme=option1`
114 |
115 | ## Examples
116 |
117 | You can see a live example in [the example folder](https://github.com/mgonto/angular-ux/tree/master/example).
118 |
119 | To start the sample, just run `serve` or `python -M SimpleHTTPServer` on **the repository root** and then go to `http://localhost:3000/example/`
120 |
121 | ## License
122 |
123 | MIT
124 |
--------------------------------------------------------------------------------
/bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "angular-ux",
3 | "version": "0.0.2",
4 | "authors": [
5 | {
6 | "name": "Martin Gontovnikas",
7 | "email": "martin@gon.to",
8 | "url": "http://gon.to/"
9 | }
10 | ],
11 | "main": [
12 | "dist/angular-ux.js"
13 | ],
14 | "ignore": [
15 | "src",
16 | "test",
17 | "gulpfile.js",
18 | "**/.*"
19 | ],
20 | "dependencies": {
21 | "angular": "~1.3.14"
22 | },
23 | "devDependencies": {
24 | "angular-mocks": "~1.3.14",
25 | "angular-scenario": "~1.3.14"
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/dist/angular-ux.js:
--------------------------------------------------------------------------------
1 | (function() {
2 |
3 |
4 | // Create all modules and define dependencies to make sure they exist
5 | // and are loaded in the correct order to satisfy dependency injection
6 | // before all nested files are concatenated by Grunt
7 |
8 | // Modules
9 | angular.module('ux',
10 | [
11 | 'ux.pages',
12 | 'ux.themes'
13 | ]);
14 |
15 | angular.module('ux.global', [])
16 | .service('uxGlobal', ["$location", function($location) {
17 | this.pages = [];
18 | this.currentPage = null;
19 |
20 | this.registerPage = function(name, home) {
21 | this.pages.push(name);
22 | if (home || $location.search().page == name) {
23 | this.changePage(name, !$location.search().page);
24 | }
25 | };
26 |
27 | this.changePage = function(name, changeUrl) {
28 | if (this.pages.indexOf(name) < 0) {
29 | throw new Error("The page you want to go to doesn't exist");
30 | }
31 | if (changeUrl) {
32 | var params = $location.search();
33 | params.page = name;
34 | $location.search(params);
35 | }
36 | this.currentPage = name;
37 | };
38 | }])
39 |
40 | angular.module('ux.pages', ['ux.global'])
41 | .directive('uxPage', function() {
42 | return {
43 | restrict: 'E',
44 | replace: true,
45 | template: '
Message from home: {{data.message || 'No message'}}
8 |
Gonto is a tech nerd that works as a Developer Advocate at Auth0. He <3 OSS, JS, meat and a good beer in that order. He has built Restangular, factory_pal, angular-jwt and many other OSS projects!
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam mauris tellus, vehicula ut tellus id, suscipit dapibus tortor. Integer viverra turpis ac fringilla hendrerit. Sed faucibus posuere felis et pellentesque. Cras varius tortor vitae molestie tempor. Proin ut viverra elit, ac gravida tortor.