Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iusto molestias libero beatae aliquam hic illo minus, vel quo fugiat rem, fugit eaque officia pariatur deleniti temporibus accusantium a dolorum quidem.
') + 4;
+ var content = contentIndex === -1 ? item.content : item.content.substring(contentIndex);
+
+ articles.push({
+ id: item.id,
+ title: item.title,
+ brief: htmlToPlainText(item.excerpt),
+ image: imageUrl,
+ date: item.date,
+ content: content,
+ author: item.author.name,
+ tags: tags,
+ url: url
+ });
+ });
+ return articles;
+ });
+ }
+
+ function getArticle(articleId) {
+ if (articles.length) {
+ return $q.when(_.find(articles, 'id', articleId));
+ } else {
+ var deferred = $q.defer();
+
+ getArticles()
+ .then(function() {
+ deferred.resolve(_.find(articles, 'id', articleId));
+ });
+
+ return deferred.promise;
+ }
+ }
+ }
+})();
diff --git a/app/styles/common.scss b/app/styles/common.scss
new file mode 100644
index 0000000..15efa52
--- /dev/null
+++ b/app/styles/common.scss
@@ -0,0 +1,40 @@
+/* Empty. Add your own CSS if you like */
+img {max-width: 100%;}
+
+.content-inner{padding: 16px;}
+
+.card.col{padding: 0;}
+
+/*
+ * Android. Action sheet
+ */
+.platform-android .action-sheet .button {
+ padding-left: 16px;
+}
+
+.has-extended-footer {
+ bottom: $extended-footer-height;
+}
+
+.extended-footer {
+ height: $extended-footer-height;
+ .subtitle {
+ text-align: center;
+ width: 100%;
+ position: absolute;
+ bottom: 10px;
+ left: -5px;
+ }
+}
+
+.item-icon-left-extended {
+ padding-left: 80px;
+ .icon {
+ left: 20px;
+ font-size: 50px;
+ }
+}
+
+.error-message {
+ color: orangered !important;
+}
\ No newline at end of file
diff --git a/app/styles/events.scss b/app/styles/events.scss
new file mode 100644
index 0000000..bd2986f
--- /dev/null
+++ b/app/styles/events.scss
@@ -0,0 +1,26 @@
+/*
+ * Events
+ */
+
+.cal-month-day {
+ height: 80px;
+}
+.cal-month-box [class*="cal-cell"] {
+ min-height: 80px;
+}
+
+.pull-right {
+ float: right !important;
+}
+
+.pull-left {
+ float: left !important;
+}
+
+.event-item {
+ text-decoration: none;
+}
+
+.cal-day-tick .fa {
+ display: inline-block;
+}
\ No newline at end of file
diff --git a/app/styles/facebook.scss b/app/styles/facebook.scss
new file mode 100644
index 0000000..8d103f6
--- /dev/null
+++ b/app/styles/facebook.scss
@@ -0,0 +1,7 @@
+/*
+ * Facebook galeries Crop the container of the images to a max height
+ */
+
+.image-container-crop-300{
+ max-height: 300px
+}
diff --git a/app/styles/home.scss b/app/styles/home.scss
new file mode 100644
index 0000000..2b28b0f
--- /dev/null
+++ b/app/styles/home.scss
@@ -0,0 +1,24 @@
+
+/*
+ * Home
+ */
+ .home-hello{
+ position:relative;
+ }
+
+ .home img{
+ display: inherit;
+ }
+
+ .home-hello .item{
+ position: absolute;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ margin: 0;
+ border: 0;
+ background: rgba(255,255,255, 0.6);
+ }
+
+ .card.col.home h1{text-align: center;}
+ .card.col.home h2{text-align: center;}
diff --git a/app/styles/instagram.scss b/app/styles/instagram.scss
new file mode 100644
index 0000000..c4c83a6
--- /dev/null
+++ b/app/styles/instagram.scss
@@ -0,0 +1,8 @@
+/*
+ * Instagram
+ */
+.instagram-created-time {
+ position: absolute;
+ top: 14px;
+ right: 10px;
+}
diff --git a/app/styles/main.scss b/app/styles/main.scss
new file mode 100644
index 0000000..7986a35
--- /dev/null
+++ b/app/styles/main.scss
@@ -0,0 +1,36 @@
+/*
+To customize the look and feel of Ionic, you can override the variables
+in ionic's _variables.scss file.
+
+For example, you might change some of the default colors:
+
+$light: #fff !default;
+$stable: #f8f8f8 !default;
+$positive: #387ef5 !default;
+$calm: #11c1f3 !default;
+$balanced: #33cd5f !default;
+$energized: #ffc900 !default;
+$assertive: #ef473a !default;
+$royal: #886aea !default;
+$dark: #444 !default;
+*/
+
+// The path for our ionicons font files, relative to the built CSS in www/css
+$ionicons-font-path: "../fonts" !default;
+
+$extended-footer-height: 70px;
+
+// Include all of Ionic
+@import "../bower_components/ionic/scss/ionic";
+
+@import "common";
+@import "facebook";
+@import "home";
+@import "instagram";
+@import "map";
+@import "rss";
+@import "stream";
+@import "events";
+@import "swipeable-cards";
+@import "tinder-cards";
+@import "restaurant-catalogue";
\ No newline at end of file
diff --git a/app/styles/map.scss b/app/styles/map.scss
new file mode 100644
index 0000000..960562f
--- /dev/null
+++ b/app/styles/map.scss
@@ -0,0 +1,11 @@
+/*
+ * Map
+ */
+
+ #map-view .scroll {
+ height: 100%;
+ }
+
+ .gmaps {
+ height: 100%;
+ }
diff --git a/app/styles/restaurant-catalogue.scss b/app/styles/restaurant-catalogue.scss
new file mode 100644
index 0000000..f0c5ab1
--- /dev/null
+++ b/app/styles/restaurant-catalogue.scss
@@ -0,0 +1,8 @@
+#take-away-map-view {
+ .scroll {
+ height: 100%;
+ }
+ .gmaps {
+ height: 50%;
+ }
+}
\ No newline at end of file
diff --git a/app/styles/rss.scss b/app/styles/rss.scss
new file mode 100644
index 0000000..8c8e7ec
--- /dev/null
+++ b/app/styles/rss.scss
@@ -0,0 +1,26 @@
+/*
+ * RSS
+ */
+
+p.postby {
+ font-size: 80%;
+ font-style: italic;
+}
+
+p.categories {
+ font-size: 80%;
+}
+
+.video-container {
+ position: relative;
+ padding-bottom: 56.25%;
+ padding-top: 30px; height: 0; overflow: hidden;
+}
+
+.video-container iframe, .video-container object, .video-container embed {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+}
\ No newline at end of file
diff --git a/app/styles/stream.scss b/app/styles/stream.scss
new file mode 100644
index 0000000..a183c47
--- /dev/null
+++ b/app/styles/stream.scss
@@ -0,0 +1,44 @@
+/*
+ * Stream
+ */
+
+.stream-background {
+ background: url('http://lorempixel.com/1024/768/') center center;
+ background-size: cover;
+}
+
+.play-button-icon.icon:before {
+ font-size: 200px;
+ color: white;
+}
+
+.center {
+ display: -webkit-box;
+ display: -moz-box;
+ display: -ms-flexbox;
+ display: -webkit-flex;
+ display: flex;
+ -webkit-box-direction: normal;
+ -moz-box-direction: normal;
+ -webkit-box-orient: horizontal;
+ -moz-box-orient: horizontal;
+ -webkit-flex-direction: row;
+ -ms-flex-direction: row;
+ flex-direction: row;
+ -webkit-flex-wrap: nowrap;
+ -ms-flex-wrap: nowrap;
+ flex-wrap: nowrap;
+ -webkit-box-pack: center;
+ -moz-box-pack: center;
+ -webkit-justify-content: center;
+ -ms-flex-pack: center;
+ justify-content: center;
+ -webkit-align-content: stretch;
+ -ms-flex-line-pack: stretch;
+ align-content: stretch;
+ -webkit-box-align: center;
+ -moz-box-align: center;
+ -webkit-align-items: center;
+ -ms-flex-align: center;
+ align-items: center;
+}
diff --git a/app/styles/swipeable-cards.scss b/app/styles/swipeable-cards.scss
new file mode 100644
index 0000000..9fdb85e
--- /dev/null
+++ b/app/styles/swipeable-cards.scss
@@ -0,0 +1,59 @@
+.swipe-cards {
+ position: fixed;
+}
+
+swipe-card {
+ display: none;
+ position: fixed;
+ -webkit-transform: scale(1,1);
+ left: 50%;
+ top: 50%;
+ width: 300px;
+ height: 300px;
+ margin-left: -150px;
+ margin-top: -150px;
+ box-sizing: border-box;
+ background-color: rgb(255,255,255);
+ border-radius: 4px;
+ overflow: hidden;
+ -webkit-animation-fill-mode: forwards;
+}
+
+swipe-card .title {
+ height: 40px;
+ padding: 5px;
+ line-height: 30px;
+ color: #444;
+ background-color: lightgray;
+ font-size: 1.2em;
+}
+swipe-card .image {
+ overflow: hidden;
+ max-height: 300px;
+}
+swipe-card .button {
+ border: none;
+}
+swipe-card .image img {
+ width: 100%;
+ border-radius: 0px 0px 4px 4px;
+}
+
+@-webkit-keyframes bounceIn {
+ 0% {
+ -webkit-transform: scale(0,0);
+ }
+ 70% {
+ -webkit-transform: scale(1.2,1.2);
+ }
+ 100% {
+ -webkit-transform: scale(1,1);
+ }
+}
+
+swipe-card.pop-in-start {
+ -webkit-transform: scale(0,0);
+}
+swipe-card.pop-in {
+ -webkit-animation: bounceIn 0.4s ease-out;
+}
diff --git a/app/styles/tinder-cards.scss b/app/styles/tinder-cards.scss
new file mode 100644
index 0000000..8a0806a
--- /dev/null
+++ b/app/styles/tinder-cards.scss
@@ -0,0 +1,49 @@
+td-cards {
+ display: block;
+}
+
+td-card {
+ position: absolute;
+ left: 50%;
+ margin-top: 80px;
+ margin-bottom: 40px;
+ margin-left: -150px;
+ width: 300px;
+ height: 300px;
+
+ border: 1px solid #999;
+ box-shadow: 0px 1px 3px rgba(0,0,0,0.2);
+ border-radius: 6px;
+}
+
+td-card .image {
+ position: relative;
+}
+
+td-card img {
+ max-width: 100%;
+ border-radius: 6px;
+}
+
+.yes-text {
+ position: absolute;
+ top: 10px;
+ left: 10px;
+ font-size: 30px;
+ color: rgb(111, 250, 111);
+ opacity: 0;
+}
+.no-text {
+ position: absolute;
+ top: 10px;
+ right: 10px;
+ font-size: 30px;
+ color: rgb(255, 115, 115);
+ opacity: 0;
+}
+
+.fade {
+ -webkit-transition: 0.2s opacity linear;
+ transition: 0.2s opacity linear;
+ opacity: 0;
+}
diff --git a/bower.json b/bower.json
new file mode 100644
index 0000000..3426a14
--- /dev/null
+++ b/bower.json
@@ -0,0 +1,34 @@
+{
+ "name": "Supermodular",
+ "version": "2.11.0",
+ "dependencies": {
+ "ionic": "~1.1.0",
+ "angular-websocket": "~1.0.9",
+ "ngCordova": "~0.1.18-alpha",
+ "lodash": "~3.8.0",
+ "angular-base64": "~2.0.4",
+ "ionic-service-core": "~0.1.3",
+ "ionic-service-push": "~0.1.3",
+ "angular-moment": "~0.10.1",
+ "angular-local-storage": "~0.2.2",
+ "angular-google-chart": "~0.0.11",
+ "angularfire": "~1.1.1",
+ "angular-bootstrap-calendar": "~0.11.3",
+ "components-font-awesome": "~4.3.0",
+ "ng-cordova-oauth": "~0.1.4",
+ "ng-twitter-api": "~0.1.5",
+ "ionic-ion-swipe-cards": "*",
+ "ionic-ion-tinder-cards": "ionic-contrib-tinder-cards#*"
+ },
+ "devDependencies": {
+ "angular-mocks": "~1.3.6",
+ "angular-scenario": "~1.3.6",
+ "ngCordova": "~0.1.15-alpha",
+ "ionic-service-core": "~0.1.10",
+ "ionic-service-push": "~0.1.4",
+ "ionic": "driftyco/ionic-bower#1.1.0"
+ },
+ "resolutions": {
+ "angular": ">= 1.3.6"
+ }
+}
diff --git a/config.xml b/config.xml
new file mode 100644
index 0000000..ce2790e
--- /dev/null
+++ b/config.xml
@@ -0,0 +1,55 @@
+
+
+ Supermodular
+
+ Supermodular Ionic. The boostrap you need in order to build your next Ionic application.
+
+
+ Stavros Kounis
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/hooks/README.md b/hooks/README.md
new file mode 100644
index 0000000..62e58b4
--- /dev/null
+++ b/hooks/README.md
@@ -0,0 +1,196 @@
+
+# Cordova Hooks
+
+Cordova Hooks represent special scripts which could be added by application and plugin developers or even by your own build system to customize cordova commands. Hook scripts could be defined by adding them to the special predefined folder (`/hooks`) or via configuration files (`config.xml` and `plugin.xml`) and run serially in the following order:
+* Application hooks from `/hooks`;
+* Application hooks from `config.xml`;
+* Plugin hooks from `plugins/.../plugin.xml`.
+
+__Remember__: Make your scripts executable.
+
+__Note__: `.cordova/hooks` directory is also supported for backward compatibility, but we don't recommend using it as it is deprecated.
+
+## Supported hook types
+The following hook types are supported:
+
+ after_build/
+ after_compile/
+ after_docs/
+ after_emulate/
+ after_platform_add/
+ after_platform_rm/
+ after_platform_ls/
+ after_plugin_add/
+ after_plugin_ls/
+ after_plugin_rm/
+ after_plugin_search/
+ after_plugin_install/ <-- Plugin hooks defined in plugin.xml are executed exclusively for a plugin being installed
+ after_prepare/
+ after_run/
+ after_serve/
+ before_build/
+ before_compile/
+ before_docs/
+ before_emulate/
+ before_platform_add/
+ before_platform_rm/
+ before_platform_ls/
+ before_plugin_add/
+ before_plugin_ls/
+ before_plugin_rm/
+ before_plugin_search/
+ before_plugin_install/ <-- Plugin hooks defined in plugin.xml are executed exclusively for a plugin being installed
+ before_plugin_uninstall/ <-- Plugin hooks defined in plugin.xml are executed exclusively for a plugin being uninstalled
+ before_prepare/
+ before_run/
+ before_serve/
+ pre_package/ <-- Windows 8 and Windows Phone only.
+
+## Ways to define hooks
+### Via '/hooks' directory
+To execute custom action when corresponding hook type is fired, use hook type as a name for a subfolder inside 'hooks' directory and place you script file here, for example:
+
+ # script file will be automatically executed after each build
+ hooks/after_build/after_build_custom_action.js
+
+
+### Config.xml
+
+Hooks can be defined in project's `config.xml` using `` elements, for example:
+
+
+
+
+
+
+
+
+
+ ...
+
+
+
+
+
+
+ ...
+
+
+### Plugin hooks (plugin.xml)
+
+As a plugin developer you can define hook scripts using `` elements in a `plugin.xml` like that:
+
+
+
+
+
+
+
+ ...
+
+
+`before_plugin_install`, `after_plugin_install`, `before_plugin_uninstall` plugin hooks will be fired exclusively for the plugin being installed/uninstalled.
+
+## Script Interface
+
+### Javascript
+
+If you are writing hooks in Javascript you should use the following module definition:
+```javascript
+module.exports = function(context) {
+ ...
+}
+```
+
+You can make your scipts async using Q:
+```javascript
+module.exports = function(context) {
+ var Q = context.requireCordovaModule('q');
+ var deferral = new Q.defer();
+
+ setTimeout(function(){
+ console.log('hook.js>> end');
+ deferral.resolve();
+ }, 1000);
+
+ return deferral.promise;
+}
+```
+
+`context` object contains hook type, executed script full path, hook options, command-line arguments passed to Cordova and top-level "cordova" object:
+```json
+{
+ "hook": "before_plugin_install",
+ "scriptLocation": "c:\\script\\full\\path\\appBeforePluginInstall.js",
+ "cmdLine": "The\\exact\\command\\cordova\\run\\with arguments",
+ "opts": {
+ "projectRoot":"C:\\path\\to\\the\\project",
+ "cordova": {
+ "platforms": ["wp8"],
+ "plugins": ["com.plugin.withhooks"],
+ "version": "0.21.7-dev"
+ },
+ "plugin": {
+ "id": "com.plugin.withhooks",
+ "pluginInfo": {
+ ...
+ },
+ "platform": "wp8",
+ "dir": "C:\\path\\to\\the\\project\\plugins\\com.plugin.withhooks"
+ }
+ },
+ "cordova": {...}
+}
+
+```
+`context.opts.plugin` object will only be passed to plugin hooks scripts.
+
+You can also require additional Cordova modules in your script using `context.requireCordovaModule` in the following way:
+```javascript
+var Q = context.requireCordovaModule('q');
+```
+
+__Note__: new module loader script interface is used for the `.js` files defined via `config.xml` or `plugin.xml` only.
+For compatibility reasons hook files specified via `/hooks` folders are run via Node child_process spawn, see 'Non-javascript' section below.
+
+### Non-javascript
+
+Non-javascript scripts are run via Node child_process spawn from the project's root directory and have the root directory passes as the first argument. All other options are passed to the script using environment variables:
+
+* CORDOVA_VERSION - The version of the Cordova-CLI.
+* CORDOVA_PLATFORMS - Comma separated list of platforms that the command applies to (e.g.: android, ios).
+* CORDOVA_PLUGINS - Comma separated list of plugin IDs that the command applies to (e.g.: org.apache.cordova.file, org.apache.cordova.file-transfer)
+* CORDOVA_HOOK - Path to the hook that is being executed.
+* CORDOVA_CMDLINE - The exact command-line arguments passed to cordova (e.g.: cordova run ios --emulate)
+
+If a script returns a non-zero exit code, then the parent cordova command will be aborted.
+
+## Writing hooks
+
+We highly recommend writing your hooks using Node.js so that they are
+cross-platform. Some good examples are shown here:
+
+[http://devgirl.org/2013/11/12/three-hooks-your-cordovaphonegap-project-needs/](http://devgirl.org/2013/11/12/three-hooks-your-cordovaphonegap-project-needs/)
+
+Also, note that even if you are working on Windows, and in case your hook scripts aren't bat files (which is recommended, if you want your scripts to work in non-Windows operating systems) Cordova CLI will expect a shebang line as the first line for it to know the interpreter it needs to use to launch the script. The shebang line should match the following example:
+
+ #!/usr/bin/env [name_of_interpreter_executable]
diff --git a/hooks/after_platform_add/install_plugins.js b/hooks/after_platform_add/install_plugins.js
new file mode 100644
index 0000000..37ea854
--- /dev/null
+++ b/hooks/after_platform_add/install_plugins.js
@@ -0,0 +1,19 @@
+#!/usr/bin/env node
+
+/**
+ * Install all plugins listed in package.json
+ */
+var exec = require('child_process').exec;
+var path = require('path');
+var sys = require('sys');
+
+var packageJSON = require('../../package.json');
+var cmd = process.platform === 'win32' ? 'cordova.cmd' : 'cordova';
+var script = path.resolve(__dirname, '../../node_modules/cordova/bin', cmd);
+
+packageJSON.cordovaPlugins = packageJSON.cordovaPlugins || [];
+packageJSON.cordovaPlugins.forEach(function (plugin) {
+ exec(script + ' plugin add ' + plugin, function (error, stdout, stderr) {
+ sys.puts(stdout);
+ });
+});
diff --git a/hooks/after_plugin_add/register_plugins.js b/hooks/after_plugin_add/register_plugins.js
new file mode 100644
index 0000000..bbcd018
--- /dev/null
+++ b/hooks/after_plugin_add/register_plugins.js
@@ -0,0 +1,20 @@
+#!/usr/bin/env node
+
+/**
+ * Push plugins to cordovaPlugins array after_plugin_add
+ */
+var fs = require('fs');
+var packageJSON = require('../../package.json');
+
+packageJSON.cordovaPlugins = packageJSON.cordovaPlugins || [];
+
+var fromEnv = process.env.CORDOVA_PLUGINS.split(',');
+for (var i = 0; i < fromEnv.length; i++) {
+ var plugin = fromEnv[i];
+
+ if (packageJSON.cordovaPlugins.indexOf(plugin) !== -1) {
+ packageJSON.cordovaPlugins.push(plugin);
+ }
+}
+
+fs.writeFileSync('package.json', JSON.stringify(packageJSON, null, 2));
diff --git a/hooks/after_plugin_rm/deregister_plugins.js b/hooks/after_plugin_rm/deregister_plugins.js
new file mode 100644
index 0000000..14ca171
--- /dev/null
+++ b/hooks/after_plugin_rm/deregister_plugins.js
@@ -0,0 +1,15 @@
+#!/usr/bin/env node
+
+/**
+ * Remove plugins from cordovaPlugins array after_plugin_rm
+ */
+var fs = require('fs');
+var _ = require('lodash');
+var packageJSON = require('../../package.json');
+
+packageJSON.cordovaPlugins = packageJSON.cordovaPlugins || [];
+_.each(process.env.CORDOVA_PLUGINS.split(','), function (plugin) {
+ _.remove(packageJSON.cordovaPlugins, function (p) { return p === plugin; });
+});
+
+fs.writeFile('package.json', JSON.stringify(packageJSON, null, 2));
diff --git a/hooks/after_prepare/icons_and_splashscreens.js b/hooks/after_prepare/icons_and_splashscreens.js
new file mode 100644
index 0000000..bb530a1
--- /dev/null
+++ b/hooks/after_prepare/icons_and_splashscreens.js
@@ -0,0 +1,78 @@
+#!/usr/bin/env node
+/**
+ * Algorithm
+ * [1] Look at all installed platforms
+ * [2] Copy (non-destructive) icons and splash screens from platform to local RESOURCE_DIR
+ * [3] Copy (destructive) matching icons and splash screens from RESOURCE_DIR to platform
+ *
+ * This ensures that local RESOURCE_DIR will be pre-scaffolded with icons and splash
+ * screens generated by Cordova as placeholder ONLY for installed platforms and that
+ * any modifications to local assets are reflected in the CORRECT Cordova platform
+ * locations, without having to hardcode file paths.
+ */
+var fs = require('fs');
+var path = require('path');
+var _ = require('lodash');
+var ncp = require('ncp');
+var mkdirp = require('mkdirp');
+var glob = require('glob');
+var Orchestrator = require('orchestrator');
+
+var BASES = {
+ android: 'res',
+ ios: 'Supermodular/Resources'
+};
+var RESOURCE_DIR = 'resources';
+
+// Helper function for file copying that ensures directory existence.
+function copyFile (src, dest, ncpOpts, callback) {
+ var orchestrator = new Orchestrator();
+ var parts = dest.split(path.sep);
+ var fileName = parts.pop();
+ var destDir = parts.join(path.sep);
+ var destFile = path.resolve(destDir, fileName);
+ orchestrator.add('ensureDir', function (done) {
+ mkdirp(destDir, function (err) {
+ done(err);
+ });
+ });
+ orchestrator.add('copyFile', ['ensureDir'], function (done) {
+ ncp(src, destFile, ncpOpts, function (err) {
+ done(err);
+ });
+ });
+ orchestrator.start('copyFile', function (err) {
+ callback(err);
+ });
+}
+
+// Main
+var platforms = _.filter(fs.readdirSync('platforms'), function (file) {
+ return fs.statSync(path.resolve('platforms', file)).isDirectory();
+});
+_.each(platforms, function (platform) {
+ var base = path.resolve('platforms', platform, BASES[platform]);
+ glob(base + '/**/*.png', function (err, files) {
+ _.each(files, function (cordovaFile) {
+ var orchestrator = new Orchestrator();
+ var parts = cordovaFile.split('/');
+ var fileName = parts.pop();
+ var localDir = path.resolve(RESOURCE_DIR, platform, _.last(parts));
+ var localFile = path.resolve(localDir, fileName);
+
+ orchestrator.add('copyFromCordova', function (done) {
+ copyFile(cordovaFile, localFile, { clobber: false }, function (err) {
+ done(err);
+ });
+ });
+ orchestrator.add('copyToCordova', ['copyFromCordova'], function (done) {
+ copyFile(localFile, cordovaFile, { clobber: true }, function (err) {
+ done(err);
+ });
+ });
+ orchestrator.start('copyToCordova', function (err) {
+ if (err) { console.error(err); }
+ });
+ });
+ });
+});
diff --git a/hooks/after_prepare/update_platform_config.js b/hooks/after_prepare/update_platform_config.js
new file mode 100644
index 0000000..a94b484
--- /dev/null
+++ b/hooks/after_prepare/update_platform_config.js
@@ -0,0 +1,344 @@
+#!/usr/bin/env node
+
+/** This hook updates platform configuration files based on preferences and config-file data defined in config.xml.
+ Currently only the AndroidManifest.xml and IOS *-Info.plist file are supported.
+
+ Preferences:
+ 1. Preferences defined outside of the platform element will apply to all platforms
+ 2. Preferences defined inside a platform element will apply only to the specified platform
+ 3. Platform preferences take precedence over common preferences
+ 4. The preferenceMappingData object contains all of the possible custom preferences to date including the
+ target file they belong to, parent element, and destination element or attribute
+
+ Config Files
+ 1. config-file elements MUST be defined inside a platform element, otherwise they will be ignored.
+ 2. config-file target attributes specify the target file to update. (AndroidManifest.xml or *-Info.plist)
+ 3. config-file parent attributes specify the parent element (AndroidManifest.xml) or parent key (*-Info.plist)
+ that the child data will replace or be appended to.
+ 4. config-file elements are uniquely indexed by target AND parent for each platform.
+ 5. If there are multiple config-file's defined with the same target AND parent, the last config-file will be used
+ 6. Elements defined WITHIN a config-file will replace or be appended to the same elements relative to the parent element
+ 7. If a unique config-file contains multiples of the same elements (other than uses-permssion elements which are
+ selected by by the uses-permission name attribute), the last defined element will be retrieved.
+
+ Examples:
+
+ AndroidManifest.xml
+ NOTE: For possible manifest values see http://developer.android.com/guide/topics/manifest/manifest-intro.html
+
+
+ //These preferences are actually available in Cordova by default although not currently documented
+
+
+
+
+ //custom preferences examples
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ *-Info.plist
+
+
+
+
+ UIInterfaceOrientationLandscapeOmg
+
+
+
+
+ someValue
+
+
+
+ NOTE: Currently, items aren't removed from the platform config files if you remove them from config.xml.
+ For example, if you add a custom permission, build the remove it, it will still be in the manifest.
+ If you make a mistake, for example adding an element to the wrong parent, you may need to remove and add your platform,
+ or revert to your previous manifest/plist file.
+
+ TODO: We may need to capture all default manifest/plist elements/keys created by Cordova along with any plugin elements/keys to compare against custom elements to remove.
+ */
+
+// global vars
+var fs = require('fs');
+var path = require('path');
+var _ = require('lodash');
+var et = require('elementtree');
+var plist = require('plist');
+
+var rootdir = path.resolve(__dirname, '../../');
+
+var platformConfig = (function(){
+ /* Global object that defines the available custom preferences for each platform.
+ Maps a config.xml preference to a specific target file, parent element, and destination attribute or element
+ */
+ var preferenceMappingData = {
+ 'android': {
+ 'android-manifest-hardwareAccelerated': {target: 'AndroidManifest.xml', parent: './', destination: 'android:hardwareAccelerated'},
+ 'android-installLocation': {target: 'AndroidManifest.xml', parent: './', destination: 'android:installLocation'},
+ 'android-activity-hardwareAccelerated': {target: 'AndroidManifest.xml', parent: 'application', destination: 'android:hardwareAccelerated'},
+ 'android-configChanges': {target: 'AndroidManifest.xml', parent: 'application/activity[@android:name=\'CordovaApp\']', destination: 'android:configChanges'},
+ 'android-launchMode': {target: 'AndroidManifest.xml', parent: 'application/activity[@android:name=\'CordovaApp\']', destination: 'android:launchMode'},
+ 'android-theme': {target: 'AndroidManifest.xml', parent: 'application/activity[@android:name=\'CordovaApp\']', destination: 'android:theme'},
+ 'android-windowSoftInputMode': {target: 'AndroidManifest.xml', parent: 'application/activity[@android:name=\'CordovaApp\']', destination: 'android:windowSoftInputMode'}
+ },
+ 'ios': {}
+ };
+ var configXmlData, preferencesData;
+
+ return {
+ // Parses a given file into an elementtree object
+ parseElementtreeSync: function (filename) {
+ var contents = fs.readFileSync(filename, 'utf-8');
+ if(contents) {
+ //Windows is the BOM. Skip the Byte Order Mark.
+ contents = contents.substring(contents.indexOf('<'));
+ }
+ return new et.ElementTree(et.XML(contents));
+ },
+
+ // Converts an elementtree object to an xml string. Since this is used for plist values, we don't care about attributes
+ eltreeToXmlString: function (data) {
+ var tag = data.tag;
+ var el = '<' + tag + '>';
+
+ if(data.text && data.text.trim()) {
+ el += data.text.trim();
+ } else {
+ _.each(data.getchildren(), function (child) {
+ el += platformConfig.eltreeToXmlString(child);
+ });
+ }
+
+ el += '' + tag + '>';
+ return el;
+ },
+
+ // Parses the config.xml into an elementtree object and stores in the config object
+ getConfigXml: function () {
+ if(!configXmlData) {
+ configXmlData = this.parseElementtreeSync(path.join(rootdir, 'config.xml'));
+ }
+
+ return configXmlData;
+ },
+
+ /* Retrieves all from config.xml and returns a map of preferences with platform as the key.
+ If a platform is supplied, common prefs + platform prefs will be returned, otherwise just common prefs are returned.
+ */
+ getPreferences: function (platform) {
+ var configXml = this.getConfigXml();
+
+ //init common config.xml prefs if we haven't already
+ if(!preferencesData) {
+ preferencesData = {
+ common: configXml.findall('preference')
+ };
+ }
+
+ var prefs = preferencesData.common || [];
+ if(platform) {
+ if(!preferencesData[platform]) {
+ preferencesData[platform] = configXml.findall('platform[@name=\'' + platform + '\']/preference');
+ }
+ prefs = prefs.concat(preferencesData[platform]);
+ }
+
+ return prefs;
+ },
+
+ /* Retrieves all configured xml for a specific platform/target/parent element nested inside a platforms config-file
+ element within the config.xml. The config-file elements are then indexed by target|parent so if there are
+ any config-file elements per platform that have the same target and parent, the last config-file element is used.
+ */
+ getConfigFilesByTargetAndParent: function (platform) {
+ var configFileData = this.getConfigXml().findall('platform[@name=\'' + platform + '\']/config-file');
+
+ return _.indexBy(configFileData, function(item) {
+ var parent = item.attrib.parent;
+ //if parent attribute is undefined /* or */, set parent to top level elementree selector
+ if(!parent || parent === '/*' || parent === '*/') {
+ parent = './';
+ }
+ return item.attrib.target + '|' + parent;
+ });
+ },
+
+ // Parses the config.xml's preferences and config-file elements for a given platform
+ parseConfigXml: function (platform) {
+ var configData = {};
+ this.parsePreferences(configData, platform);
+ this.parseConfigFiles(configData, platform);
+
+ return configData;
+ },
+
+ // Retrieves the config.xml's pereferences for a given platform and parses them into JSON data
+ parsePreferences: function (configData, platform) {
+ var preferences = this.getPreferences(platform),
+ type = 'preference';
+
+ _.each(preferences, function (preference) {
+ var prefMappingData = preferenceMappingData[platform][preference.attrib.name],
+ target,
+ prefData;
+
+ if (prefMappingData) {
+ prefData = {
+ parent: prefMappingData.parent,
+ type: type,
+ destination: prefMappingData.destination,
+ data: preference
+ };
+
+ target = prefMappingData.target;
+ if(!configData[target]) {
+ configData[target] = [];
+ }
+ configData[target].push(prefData);
+ }
+ });
+ },
+
+ // Retrieves the config.xml's config-file elements for a given platform and parses them into JSON data
+ parseConfigFiles: function (configData, platform) {
+ var configFiles = this.getConfigFilesByTargetAndParent(platform),
+ type = 'configFile';
+
+ _.each(configFiles, function (configFile, key) {
+ var keyParts = key.split('|');
+ var target = keyParts[0];
+ var parent = keyParts[1];
+ var items = configData[target] || [];
+
+ _.each(configFile.getchildren(), function (element) {
+ items.push({
+ parent: parent,
+ type: type,
+ destination: element.tag,
+ data: element
+ });
+ });
+
+ configData[target] = items;
+ });
+ },
+
+ // Parses config.xml data, and update each target file for a specified platform
+ updatePlatformConfig: function (platform) {
+ var configData = this.parseConfigXml(platform),
+ platformPath = path.join(rootdir, 'platforms', platform);
+
+ _.each(configData, function (configItems, targetFileName) {
+ var projectName, targetFile;
+
+ if (platform === 'ios' && targetFileName.indexOf("Info.plist") > -1) {
+ projectName = platformConfig.getConfigXml().findtext('name');
+ targetFile = path.join(platformPath, projectName, projectName + '-Info.plist');
+ platformConfig.updateIosPlist(targetFile, configItems);
+ } else if (platform === 'android' && targetFileName === 'AndroidManifest.xml') {
+ targetFile = path.join(platformPath, targetFileName);
+ platformConfig.updateAndroidManifest(targetFile, configItems);
+ }
+ });
+ },
+
+ // Updates the AndroidManifest.xml target file with data from config.xml
+ updateAndroidManifest: function (targetFile, configItems) {
+ var tempManifest = platformConfig.parseElementtreeSync(targetFile),
+ root = tempManifest.getroot();
+
+ _.each(configItems, function (item) {
+ // if parent is not found on the root, child/grandchild nodes are searched
+ var parentEl = root.find(item.parent) || root.find('*/' + item.parent),
+ data = item.data,
+ childSelector = item.destination,
+ childEl;
+
+ if(!parentEl) {
+ return;
+ }
+
+ if(item.type === 'preference') {
+ parentEl.attrib[childSelector] = data.attrib['value'];
+ } else {
+ // since there can be multiple uses-permission elements, we need to select them by unique name
+ if(childSelector === 'uses-permission') {
+ childSelector += '[@android:name=\'' + data.attrib['android:name'] + '\']';
+ }
+
+ childEl = parentEl.find(childSelector);
+ // if child element doesnt exist, create new element
+ if(!childEl) {
+ childEl = new et.Element(item.destination);
+ parentEl.append(childEl);
+ }
+
+ // copy all config.xml data except for the generated _id property
+ _.each(data, function (prop, propName) {
+ if(propName !== '_id') {
+ childEl[propName] = prop;
+ }
+ });
+ }
+ });
+
+ fs.writeFileSync(targetFile, tempManifest.write({indent: 4}), 'utf-8');
+ },
+
+ /* Updates the *-Info.plist file with data from config.xml by parsing to an xml string, then using the plist
+ module to convert the data to a map. The config.xml data is then replaced or appended to the original plist file
+ */
+ updateIosPlist: function (targetFile, configItems) {
+ var infoPlist = plist.parse(fs.readFileSync(targetFile, 'utf-8')),
+ tempInfoPlist;
+
+ _.each(configItems, function (item) {
+ var key = item.parent;
+ var plistXml = '' + key + '';
+ plistXml += platformConfig.eltreeToXmlString(item.data) + '';
+
+ var configPlistObj = plist.parse(plistXml);
+ infoPlist[key] = configPlistObj[key];
+ });
+
+ tempInfoPlist = plist.build(infoPlist);
+ tempInfoPlist = tempInfoPlist.replace(/[\s\r\n]*<\/string>/g,'');
+ fs.writeFileSync(targetFile, tempInfoPlist, 'utf-8');
+ }
+ };
+})();
+
+// Main
+(function () {
+ if (rootdir) {
+ // go through each of the platform directories that have been prepared
+ var platforms = _.filter(fs.readdirSync('platforms'), function (file) {
+ return fs.statSync(path.resolve('platforms', file)).isDirectory();
+ });
+
+ _.each(platforms, function (platform) {
+ try {
+ platform = platform.trim().toLowerCase();
+ platformConfig.updatePlatformConfig(platform);
+ } catch (e) {
+ process.stdout.write(e);
+ }
+ });
+ }
+})();
\ No newline at end of file
diff --git a/hooks/before_platform_add/init_directories.js b/hooks/before_platform_add/init_directories.js
new file mode 100644
index 0000000..1d8a26a
--- /dev/null
+++ b/hooks/before_platform_add/init_directories.js
@@ -0,0 +1,19 @@
+#!/usr/bin/env node
+
+/**
+ * On a fresh clone, the local platforms/ and plugins/ directories will be
+ * missing, so ensure they get created before the first platform is added.
+ */
+var mkdirp = require('mkdirp');
+var path = require('path');
+
+var platformsDir = path.resolve(__dirname, '../../platforms');
+var pluginsDir = path.resolve(__dirname, '../../plugins');
+
+mkdirp(platformsDir, function (err) {
+ if (err) { console.error(err); }
+});
+
+mkdirp(pluginsDir, function (err) {
+ if (err) { console.error(err); }
+});
diff --git a/install.sh b/install.sh
new file mode 100644
index 0000000..17e61c1
--- /dev/null
+++ b/install.sh
@@ -0,0 +1,4 @@
+mkdir www
+bower install
+ionic state restore
+grunt build
\ No newline at end of file
diff --git a/ionic.project b/ionic.project
new file mode 100644
index 0000000..dae25ff
--- /dev/null
+++ b/ionic.project
@@ -0,0 +1,4 @@
+{
+ "name": "supermodular-ionic",
+ "app_id": ""
+}
diff --git a/misc/faces.psd b/misc/faces.psd
new file mode 100644
index 0000000..0dbbe3b
Binary files /dev/null and b/misc/faces.psd differ
diff --git a/misc/menu-items/item-01-1.jpg b/misc/menu-items/item-01-1.jpg
new file mode 100644
index 0000000..7f1396a
Binary files /dev/null and b/misc/menu-items/item-01-1.jpg differ
diff --git a/misc/menu-items/item-01-thumb.jpg b/misc/menu-items/item-01-thumb.jpg
new file mode 100644
index 0000000..73dec51
Binary files /dev/null and b/misc/menu-items/item-01-thumb.jpg differ
diff --git a/misc/menu-items/item-02-1.jpg b/misc/menu-items/item-02-1.jpg
new file mode 100644
index 0000000..f734cfb
Binary files /dev/null and b/misc/menu-items/item-02-1.jpg differ
diff --git a/misc/menu-items/item-02-thumb.jpg b/misc/menu-items/item-02-thumb.jpg
new file mode 100644
index 0000000..3805d30
Binary files /dev/null and b/misc/menu-items/item-02-thumb.jpg differ
diff --git a/misc/menu-items/item-03-1.jpg b/misc/menu-items/item-03-1.jpg
new file mode 100644
index 0000000..038b5c1
Binary files /dev/null and b/misc/menu-items/item-03-1.jpg differ
diff --git a/misc/menu-items/item-03-thumb.jpg b/misc/menu-items/item-03-thumb.jpg
new file mode 100644
index 0000000..26772e1
Binary files /dev/null and b/misc/menu-items/item-03-thumb.jpg differ
diff --git a/misc/menu-items/item-04-1.jpg b/misc/menu-items/item-04-1.jpg
new file mode 100644
index 0000000..ed2c9aa
Binary files /dev/null and b/misc/menu-items/item-04-1.jpg differ
diff --git a/misc/menu-items/item-04-thumb.jpg b/misc/menu-items/item-04-thumb.jpg
new file mode 100644
index 0000000..05063b7
Binary files /dev/null and b/misc/menu-items/item-04-thumb.jpg differ
diff --git a/misc/menu-items/item-05-1.jpg b/misc/menu-items/item-05-1.jpg
new file mode 100644
index 0000000..6dbef35
Binary files /dev/null and b/misc/menu-items/item-05-1.jpg differ
diff --git a/misc/menu-items/item-05-thumb.jpg b/misc/menu-items/item-05-thumb.jpg
new file mode 100644
index 0000000..bc25431
Binary files /dev/null and b/misc/menu-items/item-05-thumb.jpg differ
diff --git a/misc/menu-items/item-06-1.jpg b/misc/menu-items/item-06-1.jpg
new file mode 100644
index 0000000..164f10e
Binary files /dev/null and b/misc/menu-items/item-06-1.jpg differ
diff --git a/misc/menu-items/item-06-thumb.jpg b/misc/menu-items/item-06-thumb.jpg
new file mode 100644
index 0000000..786f232
Binary files /dev/null and b/misc/menu-items/item-06-thumb.jpg differ
diff --git a/misc/menu-items/item-07-1.jpg b/misc/menu-items/item-07-1.jpg
new file mode 100644
index 0000000..c209caa
Binary files /dev/null and b/misc/menu-items/item-07-1.jpg differ
diff --git a/misc/menu-items/item-07-thumb.jpg b/misc/menu-items/item-07-thumb.jpg
new file mode 100644
index 0000000..9a65682
Binary files /dev/null and b/misc/menu-items/item-07-thumb.jpg differ
diff --git a/misc/menu-items/item-08-1.jpg b/misc/menu-items/item-08-1.jpg
new file mode 100644
index 0000000..83bddbf
Binary files /dev/null and b/misc/menu-items/item-08-1.jpg differ
diff --git a/misc/menu-items/item-08-thumb.jpg b/misc/menu-items/item-08-thumb.jpg
new file mode 100644
index 0000000..9cd49ea
Binary files /dev/null and b/misc/menu-items/item-08-thumb.jpg differ
diff --git a/misc/menu-items/item-09-1.jpg b/misc/menu-items/item-09-1.jpg
new file mode 100644
index 0000000..a7628e4
Binary files /dev/null and b/misc/menu-items/item-09-1.jpg differ
diff --git a/misc/menu-items/item-09-thumb.jpg b/misc/menu-items/item-09-thumb.jpg
new file mode 100644
index 0000000..e4589fe
Binary files /dev/null and b/misc/menu-items/item-09-thumb.jpg differ
diff --git a/misc/menu-items/item-10-1.jpg b/misc/menu-items/item-10-1.jpg
new file mode 100644
index 0000000..4ed5a57
Binary files /dev/null and b/misc/menu-items/item-10-1.jpg differ
diff --git a/misc/menu-items/item-10-thumb.jpg b/misc/menu-items/item-10-thumb.jpg
new file mode 100644
index 0000000..d19b271
Binary files /dev/null and b/misc/menu-items/item-10-thumb.jpg differ
diff --git a/misc/menu-items/item-11-1.jpg b/misc/menu-items/item-11-1.jpg
new file mode 100644
index 0000000..e3aa47e
Binary files /dev/null and b/misc/menu-items/item-11-1.jpg differ
diff --git a/misc/menu-items/item-11-thumb.jpg b/misc/menu-items/item-11-thumb.jpg
new file mode 100644
index 0000000..a715498
Binary files /dev/null and b/misc/menu-items/item-11-thumb.jpg differ
diff --git a/misc/menu-items/item-12-1.jpg b/misc/menu-items/item-12-1.jpg
new file mode 100644
index 0000000..98d5c39
Binary files /dev/null and b/misc/menu-items/item-12-1.jpg differ
diff --git a/misc/menu-items/item-12-thumb.jpg b/misc/menu-items/item-12-thumb.jpg
new file mode 100644
index 0000000..11bd3d7
Binary files /dev/null and b/misc/menu-items/item-12-thumb.jpg differ
diff --git a/misc/menu-items/items.json b/misc/menu-items/items.json
new file mode 100644
index 0000000..d887390
--- /dev/null
+++ b/misc/menu-items/items.json
@@ -0,0 +1,164 @@
+{
+ "id": 1,
+ "jsonrpc": "2.0",
+ "total": 6,
+ "result": [
+ {
+ "id": 1,
+ "guid": "1d4aa3b2-c059-4fa7-a751-9bca735e4ebb",
+ "thumb": "http://skounis.s3.amazonaws.com/mobile-apps/barebone-ionic/item-01-thumb.jpg",
+ "title": "Mozzarella sticks",
+ "body": "Extra delicious Mozzarella cheese sticks, mixed with zucchini and potatoes coated with flavorful herbs. Served with a side of marinara sauce for dipping.",
+ "tags": ["mozzarella", "sticks"],
+ "url" : "http://demo.morethanthemes.com/retailplus/commerce-default/node/9",
+ "currency": "£",
+ "price" : "11.00",
+ "pictures": [
+ "http://skounis.s3.amazonaws.com/mobile-apps/barebone-ionic/item-01-1.jpg"
+ ]
+ }, {
+ "id": 2,
+ "guid": "6630fb89-94d6-4fec-a1c3-c48d80b88895",
+ "thumb": "http://skounis.s3.amazonaws.com/mobile-apps/barebone-ionic/item-02-thumb.jpg",
+ "title": "Cheesy Rosemary Monkey Bread Rolls",
+ "body": "Rosemary, garlic and cheese make these monkey bread rolls perfect with any meal.",
+ "tags": ["bread", "rosemary"],
+ "url" : "http://demo.morethanthemes.com/retailplus/commerce-default/node/10",
+ "currency": "£",
+ "price" : "11.00",
+ "pictures": [
+ "http://skounis.s3.amazonaws.com/mobile-apps/barebone-ionic/item-02-1.jpg"
+ ]
+ }, {
+ "id": 3,
+ "guid": "861d3f45-28ce-4b10-80e5-e98fafee4d4f",
+ "thumb": "http://skounis.s3.amazonaws.com/mobile-apps/barebone-ionic/item-03-thumb.jpg",
+ "title": "Sticks variety",
+ "body": "A variety of vegetable and beef sticks will keep the balance for a healthy yet tasteful starter.",
+ "tags": ["sticks", "beef", "vegetables"],
+ "url" : "http://demo.morethanthemes.com/retailplus/commerce-default/node/11",
+ "currency": "£",
+ "price" : "18.00",
+ "pictures": [
+ "http://skounis.s3.amazonaws.com/mobile-apps/barebone-ionic/item-03-1.jpg"
+ ]
+ }, {
+ "id": 4,
+ "guid": "205f2dd0-35e8-450c-9577-bb71be487fe7",
+ "thumb": "http://skounis.s3.amazonaws.com/mobile-apps/barebone-ionic/item-04-thumb.jpg",
+ "title": "Espresso coffee",
+ "body": "Classic italian espresso made with blends of 80% arabica and 20% robusta. Served with cinnamon cookies.",
+ "tags": ["coffee", "espresso"],
+ "url" : "http://demo.morethanthemes.com/retailplus/commerce-default/node/12",
+ "currency": "£",
+ "price" : "7.00",
+ "pictures": [
+ "http://skounis.s3.amazonaws.com/mobile-apps/barebone-ionic/item-04-1.jpg"
+ ]
+ }, {
+ "id": 5,
+ "guid": "4e0d6228-1ffc-46d4-ba68-22454728dd37",
+ "thumb": "http://skounis.s3.amazonaws.com/mobile-apps/barebone-ionic/item-05-thumb.jpg",
+ "title": "Plum layered dessert",
+ "body": "A delicious dessert which is low in both fat and sugar.",
+ "tags": ["plum"],
+ "url" : "http://demo.morethanthemes.com/retailplus/commerce-default/node/13",
+ "currency": "£",
+ "price" : "9.00",
+ "pictures": [
+ "http://skounis.s3.amazonaws.com/mobile-apps/barebone-ionic/item-05-1.jpg"
+ ]
+ }, {
+ "id": 6,
+ "guid": "b3119483-5125-4f6c-89a3-849ebc732447",
+ "thumb": "http://skounis.s3.amazonaws.com/mobile-apps/barebone-ionic/item-06-thumb.jpg",
+ "title": "Chocolate, raspberry and vanilla cake",
+ "body": "Cake with almond sponge, raspberry coulis and raspberry sorbet.",
+ "tags": ["cake", "raspberry", "Chocolate"],
+ "url" : "http://demo.morethanthemes.com/retailplus/commerce-default/node/14",
+ "currency": "£",
+ "price" : "7.00",
+ "pictures": [
+ "http://skounis.s3.amazonaws.com/mobile-apps/barebone-ionic/item-06-1.jpg"
+ ]
+ }, {
+ "id": 7,
+ "guid": "b3119483-5125-4f6c-89a3-849ebc732447",
+ "thumb": "http://skounis.s3.amazonaws.com/mobile-apps/barebone-ionic/item-07-thumb.jpg",
+ "title": "Strawberry heaven",
+ "body": "Crispy base smothered with a layer of light mousse is then perfectly complemented by a layer of dreamy strawberry puree.",
+ "tags": ["strawberry", "layered"],
+ "url" : "http://demo.morethanthemes.com/retailplus/commerce-default/node/14",
+ "currency": "£",
+ "price" : "9.00",
+ "pictures": [
+ "http://skounis.s3.amazonaws.com/mobile-apps/barebone-ionic/item-07-1.jpg"
+ ]
+ }, {
+ "id": 8,
+ "guid": "b3119483-5125-4f6c-89a3-849ebc732447",
+ "thumb": "http://skounis.s3.amazonaws.com/mobile-apps/barebone-ionic/item-08-thumb.jpg",
+ "title": "Mix of meat",
+ "body": "Filets and sausages served with herb roasted potatoes and roasted vegetables seasoned with rosemary and thyme.",
+ "tags": ["filet", "sausage", "red meat"],
+ "url" : "http://demo.morethanthemes.com/retailplus/commerce-default/node/14",
+ "currency": "£",
+ "price" : "21.00",
+ "pictures": [
+ "http://skounis.s3.amazonaws.com/mobile-apps/barebone-ionic/item-08-1.jpg"
+ ]
+ }, {
+ "id": 9,
+ "guid": "b3119483-5125-4f6c-89a3-849ebc732447",
+ "thumb": "http://skounis.s3.amazonaws.com/mobile-apps/barebone-ionic/item-09-thumb.jpg",
+ "title": "Handmade burgers",
+ "body": "The beef we source for our burgers is sourced from Aberdeenshire a we just love the distinctive flavour and quality.",
+ "tags": ["burger", "beef", "handmade"],
+ "url" : "http://demo.morethanthemes.com/retailplus/commerce-default/node/14",
+ "currency": "£",
+ "price" : "16.00",
+ "pictures": [
+ "http://skounis.s3.amazonaws.com/mobile-apps/barebone-ionic/item-09-1.jpg"
+ ]
+ }, {
+ "id": 10,
+ "guid": "b3119483-5125-4f6c-89a3-849ebc732447",
+ "thumb": "http://skounis.s3.amazonaws.com/mobile-apps/barebone-ionic/item-10-thumb.jpg",
+ "title": "Supreme Pizza",
+ "body": "Beef, ham, pepperoni, Italian sausage, onion, mushroom, pineapple, capsicum & peppers.",
+ "tags": ["pizza"],
+ "url" : "http://demo.morethanthemes.com/retailplus/commerce-default/node/14",
+ "currency": "£",
+ "price" : "17.00",
+ "pictures": [
+ "http://skounis.s3.amazonaws.com/mobile-apps/barebone-ionic/item-10-1.jpg"
+ ]
+ }, {
+ "id": 11,
+ "guid": "b3119483-5125-4f6c-89a3-849ebc732447",
+ "thumb": "http://skounis.s3.amazonaws.com/mobile-apps/barebone-ionic/item-11-thumb.jpg",
+ "title": "Mixed Vegetable Salad with Lime Dressing",
+ "body": "This raw mixed vegetable salad takes the green leaves out of the mix and focuses more on the topping vegetables.",
+ "tags": ["raw", "vegetables"],
+ "url" : "http://demo.morethanthemes.com/retailplus/commerce-default/node/14",
+ "currency": "£",
+ "price" : "11.00",
+ "pictures": [
+ "http://skounis.s3.amazonaws.com/mobile-apps/barebone-ionic/item-11-1.jpg"
+ ]
+ }, {
+ "id": 12,
+ "guid": "b3119483-5125-4f6c-89a3-849ebc732447",
+ "thumb": "http://skounis.s3.amazonaws.com/mobile-apps/barebone-ionic/item-12-thumb.jpg",
+ "title": "Lettuce Salad with Garlic Croutons",
+ "body": "This salad has a fresh crunch due to different kinds of lettuce, garlic croutons and nuts.",
+ "tags": ["lettuce", "croutons", "nuts"],
+ "url" : "http://demo.morethanthemes.com/retailplus/commerce-default/node/14",
+ "currency": "£",
+ "price" : "11.00",
+ "pictures": [
+ "http://skounis.s3.amazonaws.com/mobile-apps/barebone-ionic/item-12-1.jpg"
+ ]
+ }
+ ]
+}
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..57517d8
--- /dev/null
+++ b/package.json
@@ -0,0 +1,98 @@
+{
+ "name": "Supermodular",
+ "version": "2.11.0",
+ "private": true,
+ "dependencies": {},
+ "devDependencies": {
+ "cordova": "^5.3.3",
+ "elementtree": "0.1.6",
+ "glob": "~4.3.5",
+ "grunt": "~0.4.5",
+ "grunt-autoprefixer": "~2.2.0",
+ "grunt-concurrent": "1.0.0",
+ "grunt-contrib-clean": "~0.6.0",
+ "grunt-contrib-concat": "~0.5.0",
+ "grunt-contrib-connect": "~0.9.0",
+ "grunt-contrib-copy": "~0.7.0",
+ "grunt-contrib-cssmin": "~0.11.0",
+ "grunt-contrib-htmlmin": "~0.3.0",
+ "grunt-contrib-jshint": "~0.11.0",
+ "grunt-contrib-sass": "^0.9.2",
+ "grunt-contrib-uglify": "~0.7.0",
+ "grunt-contrib-watch": "~0.6.1",
+ "grunt-include-source": "^0.5.1",
+ "grunt-karma": "~0.10.1",
+ "grunt-newer": "~1.1.0",
+ "grunt-ng-annotate": "~0.9.2",
+ "grunt-ng-constant": "^1.0.0",
+ "grunt-usemin": "~3.0.0",
+ "grunt-wiredep": "^2.0.0",
+ "ionic": "^1.7.6",
+ "jshint-stylish": "~1.0.0",
+ "karma": "~0.12.31",
+ "karma-chai": "~0.1.0",
+ "karma-chrome-launcher": "~0.1.7",
+ "karma-coverage": "~0.2.7",
+ "karma-mocha": "~0.1.10",
+ "karma-phantomjs-launcher": "~0.1.4",
+ "load-grunt-tasks": "~3.1.0",
+ "lodash": "~3.1.0",
+ "mkdirp": "~0.5.0",
+ "ncp": "~1.0.1",
+ "orchestrator": "~0.3.7",
+ "plist": "1.1.0",
+ "ripple-emulator": "~0.9.24",
+ "time-grunt": "~1.0.0",
+ "win-spawn": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "scripts": {
+ "test": "grunt test",
+ "postinstall": "./install.sh"
+ },
+ "cordovaPlatforms": [
+ "ios"
+ ],
+ "cordovaPlugins": [
+ "org.apache.cordova.device",
+ "org.apache.cordova.console",
+ "com.ionic.keyboard",
+ "org.apache.cordova.inappbrowser",
+ {
+ "locator": "https://github.com/phonegap-build/PushPlugin.git",
+ "id": "com.phonegap.plugins.PushPlugin"
+ },
+ {
+ "locator": "https://github.com/katzer/cordova-plugin-email-composer.git",
+ "id": "de.appplant.cordova.plugin.email-composer"
+ },
+ "cordova-plugin-geolocation",
+ {
+ "locator": "https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin.git",
+ "id": "nl.x-services.plugins.socialsharing"
+ },
+ {
+ "locator": "https://github.com/keosuofficial/cordova-audio-stream-plugin.git",
+ "id": "com.keosu.cordova.stream"
+ },
+ "cordova-plugin-network-information",
+ "cordova-plugin-whitelist",
+ {
+ "locator": "https://github.com/pushandplay/cordova-plugin-apprate.git",
+ "id": "org.pushandplay.cordova.apprate"
+ },
+ {
+ "locator": "https://github.com/floatinghotpot/cordova-plugin-admob.git",
+ "id": "cordova-plugin-admob"
+ },
+ "cordova-plugin-camera",
+ "cordova-plugin-transport-security",
+ {
+ "locator": "https://github.com/litehelpers/Cordova-sqlite-storage.git",
+ "id": "cordova-sqlite-storage"
+ },
+ "org.apache.cordova.console"
+ ]
+}
diff --git a/resources/android/drawable-hdpi/ic_action_next_item.png b/resources/android/drawable-hdpi/ic_action_next_item.png
new file mode 100644
index 0000000..fa469d8
Binary files /dev/null and b/resources/android/drawable-hdpi/ic_action_next_item.png differ
diff --git a/resources/android/drawable-hdpi/ic_action_previous_item.png b/resources/android/drawable-hdpi/ic_action_previous_item.png
new file mode 100644
index 0000000..e861ecc
Binary files /dev/null and b/resources/android/drawable-hdpi/ic_action_previous_item.png differ
diff --git a/resources/android/drawable-hdpi/ic_action_remove.png b/resources/android/drawable-hdpi/ic_action_remove.png
new file mode 100644
index 0000000..f889617
Binary files /dev/null and b/resources/android/drawable-hdpi/ic_action_remove.png differ
diff --git a/resources/android/drawable-hdpi/icon.png b/resources/android/drawable-hdpi/icon.png
new file mode 100644
index 0000000..4d27634
Binary files /dev/null and b/resources/android/drawable-hdpi/icon.png differ
diff --git a/resources/android/drawable-land-hdpi/screen.png b/resources/android/drawable-land-hdpi/screen.png
new file mode 100644
index 0000000..a61e2b1
Binary files /dev/null and b/resources/android/drawable-land-hdpi/screen.png differ
diff --git a/resources/android/drawable-land-ldpi/screen.png b/resources/android/drawable-land-ldpi/screen.png
new file mode 100644
index 0000000..f3934cd
Binary files /dev/null and b/resources/android/drawable-land-ldpi/screen.png differ
diff --git a/resources/android/drawable-land-mdpi/screen.png b/resources/android/drawable-land-mdpi/screen.png
new file mode 100644
index 0000000..a1b697c
Binary files /dev/null and b/resources/android/drawable-land-mdpi/screen.png differ
diff --git a/resources/android/drawable-land-xhdpi/screen.png b/resources/android/drawable-land-xhdpi/screen.png
new file mode 100644
index 0000000..79f2f09
Binary files /dev/null and b/resources/android/drawable-land-xhdpi/screen.png differ
diff --git a/resources/android/drawable-ldpi/icon.png b/resources/android/drawable-ldpi/icon.png
new file mode 100644
index 0000000..cd5032a
Binary files /dev/null and b/resources/android/drawable-ldpi/icon.png differ
diff --git a/resources/android/drawable-mdpi/ic_action_next_item.png b/resources/android/drawable-mdpi/ic_action_next_item.png
new file mode 100644
index 0000000..47365a3
Binary files /dev/null and b/resources/android/drawable-mdpi/ic_action_next_item.png differ
diff --git a/resources/android/drawable-mdpi/ic_action_previous_item.png b/resources/android/drawable-mdpi/ic_action_previous_item.png
new file mode 100644
index 0000000..4ad2df4
Binary files /dev/null and b/resources/android/drawable-mdpi/ic_action_previous_item.png differ
diff --git a/resources/android/drawable-mdpi/ic_action_remove.png b/resources/android/drawable-mdpi/ic_action_remove.png
new file mode 100644
index 0000000..e84853e
Binary files /dev/null and b/resources/android/drawable-mdpi/ic_action_remove.png differ
diff --git a/resources/android/drawable-mdpi/icon.png b/resources/android/drawable-mdpi/icon.png
new file mode 100644
index 0000000..e79c606
Binary files /dev/null and b/resources/android/drawable-mdpi/icon.png differ
diff --git a/resources/android/drawable-port-hdpi/screen.png b/resources/android/drawable-port-hdpi/screen.png
new file mode 100644
index 0000000..5d6a28a
Binary files /dev/null and b/resources/android/drawable-port-hdpi/screen.png differ
diff --git a/resources/android/drawable-port-ldpi/screen.png b/resources/android/drawable-port-ldpi/screen.png
new file mode 100644
index 0000000..65ad163
Binary files /dev/null and b/resources/android/drawable-port-ldpi/screen.png differ
diff --git a/resources/android/drawable-port-mdpi/screen.png b/resources/android/drawable-port-mdpi/screen.png
new file mode 100644
index 0000000..ea15693
Binary files /dev/null and b/resources/android/drawable-port-mdpi/screen.png differ
diff --git a/resources/android/drawable-port-xhdpi/screen.png b/resources/android/drawable-port-xhdpi/screen.png
new file mode 100644
index 0000000..c2e8042
Binary files /dev/null and b/resources/android/drawable-port-xhdpi/screen.png differ
diff --git a/resources/android/drawable-xhdpi/ic_action_next_item.png b/resources/android/drawable-xhdpi/ic_action_next_item.png
new file mode 100644
index 0000000..5f30474
Binary files /dev/null and b/resources/android/drawable-xhdpi/ic_action_next_item.png differ
diff --git a/resources/android/drawable-xhdpi/ic_action_previous_item.png b/resources/android/drawable-xhdpi/ic_action_previous_item.png
new file mode 100644
index 0000000..ed8ac91
Binary files /dev/null and b/resources/android/drawable-xhdpi/ic_action_previous_item.png differ
diff --git a/resources/android/drawable-xhdpi/ic_action_remove.png b/resources/android/drawable-xhdpi/ic_action_remove.png
new file mode 100644
index 0000000..4cd0458
Binary files /dev/null and b/resources/android/drawable-xhdpi/ic_action_remove.png differ
diff --git a/resources/android/drawable-xhdpi/icon.png b/resources/android/drawable-xhdpi/icon.png
new file mode 100644
index 0000000..ec7ffbf
Binary files /dev/null and b/resources/android/drawable-xhdpi/icon.png differ
diff --git a/resources/android/drawable-xxhdpi/ic_action_next_item.png b/resources/android/drawable-xxhdpi/ic_action_next_item.png
new file mode 100644
index 0000000..51479d8
Binary files /dev/null and b/resources/android/drawable-xxhdpi/ic_action_next_item.png differ
diff --git a/resources/android/drawable-xxhdpi/ic_action_previous_item.png b/resources/android/drawable-xxhdpi/ic_action_previous_item.png
new file mode 100644
index 0000000..bc8ff12
Binary files /dev/null and b/resources/android/drawable-xxhdpi/ic_action_previous_item.png differ
diff --git a/resources/android/drawable-xxhdpi/ic_action_remove.png b/resources/android/drawable-xxhdpi/ic_action_remove.png
new file mode 100644
index 0000000..331c545
Binary files /dev/null and b/resources/android/drawable-xxhdpi/ic_action_remove.png differ
diff --git a/resources/android/drawable/icon.png b/resources/android/drawable/icon.png
new file mode 100644
index 0000000..ec7ffbf
Binary files /dev/null and b/resources/android/drawable/icon.png differ
diff --git a/resources/ios/icons/icon-40.png b/resources/ios/icons/icon-40.png
new file mode 100644
index 0000000..76cc53c
Binary files /dev/null and b/resources/ios/icons/icon-40.png differ
diff --git a/resources/ios/icons/icon-40@2x.png b/resources/ios/icons/icon-40@2x.png
new file mode 100644
index 0000000..64b4906
Binary files /dev/null and b/resources/ios/icons/icon-40@2x.png differ
diff --git a/resources/ios/icons/icon-50.png b/resources/ios/icons/icon-50.png
new file mode 100644
index 0000000..8bd51df
Binary files /dev/null and b/resources/ios/icons/icon-50.png differ
diff --git a/resources/ios/icons/icon-50@2x.png b/resources/ios/icons/icon-50@2x.png
new file mode 100644
index 0000000..2676f8f
Binary files /dev/null and b/resources/ios/icons/icon-50@2x.png differ
diff --git a/resources/ios/icons/icon-60.png b/resources/ios/icons/icon-60.png
new file mode 100644
index 0000000..11f3912
Binary files /dev/null and b/resources/ios/icons/icon-60.png differ
diff --git a/resources/ios/icons/icon-60@2x.png b/resources/ios/icons/icon-60@2x.png
new file mode 100644
index 0000000..b521048
Binary files /dev/null and b/resources/ios/icons/icon-60@2x.png differ
diff --git a/resources/ios/icons/icon-60@3x.png b/resources/ios/icons/icon-60@3x.png
new file mode 100644
index 0000000..dbc8303
Binary files /dev/null and b/resources/ios/icons/icon-60@3x.png differ
diff --git a/resources/ios/icons/icon-72.png b/resources/ios/icons/icon-72.png
new file mode 100644
index 0000000..4e5a827
Binary files /dev/null and b/resources/ios/icons/icon-72.png differ
diff --git a/resources/ios/icons/icon-72@2x.png b/resources/ios/icons/icon-72@2x.png
new file mode 100644
index 0000000..56fb29e
Binary files /dev/null and b/resources/ios/icons/icon-72@2x.png differ
diff --git a/resources/ios/icons/icon-76.png b/resources/ios/icons/icon-76.png
new file mode 100644
index 0000000..e66a90e
Binary files /dev/null and b/resources/ios/icons/icon-76.png differ
diff --git a/resources/ios/icons/icon-76@2x.png b/resources/ios/icons/icon-76@2x.png
new file mode 100644
index 0000000..3f5c942
Binary files /dev/null and b/resources/ios/icons/icon-76@2x.png differ
diff --git a/resources/ios/icons/icon-small.png b/resources/ios/icons/icon-small.png
new file mode 100644
index 0000000..de3146d
Binary files /dev/null and b/resources/ios/icons/icon-small.png differ
diff --git a/resources/ios/icons/icon-small@2x.png b/resources/ios/icons/icon-small@2x.png
new file mode 100644
index 0000000..916a02e
Binary files /dev/null and b/resources/ios/icons/icon-small@2x.png differ
diff --git a/resources/ios/icons/icon.png b/resources/ios/icons/icon.png
new file mode 100644
index 0000000..89f8c00
Binary files /dev/null and b/resources/ios/icons/icon.png differ
diff --git a/resources/ios/icons/icon@2x.png b/resources/ios/icons/icon@2x.png
new file mode 100644
index 0000000..a6687a1
Binary files /dev/null and b/resources/ios/icons/icon@2x.png differ
diff --git a/resources/ios/splash/Default-568h@2x~iphone.png b/resources/ios/splash/Default-568h@2x~iphone.png
new file mode 100644
index 0000000..d2128a6
Binary files /dev/null and b/resources/ios/splash/Default-568h@2x~iphone.png differ
diff --git a/resources/ios/splash/Default-667h.png b/resources/ios/splash/Default-667h.png
new file mode 100644
index 0000000..fc23e64
Binary files /dev/null and b/resources/ios/splash/Default-667h.png differ
diff --git a/resources/ios/splash/Default-736h.png b/resources/ios/splash/Default-736h.png
new file mode 100644
index 0000000..71b16ca
Binary files /dev/null and b/resources/ios/splash/Default-736h.png differ
diff --git a/resources/ios/splash/Default-Landscape-736h.png b/resources/ios/splash/Default-Landscape-736h.png
new file mode 100644
index 0000000..aaff74a
Binary files /dev/null and b/resources/ios/splash/Default-Landscape-736h.png differ
diff --git a/resources/ios/splash/Default-Landscape@2x~ipad.png b/resources/ios/splash/Default-Landscape@2x~ipad.png
new file mode 100644
index 0000000..19770a2
Binary files /dev/null and b/resources/ios/splash/Default-Landscape@2x~ipad.png differ
diff --git a/resources/ios/splash/Default-Landscape~ipad.png b/resources/ios/splash/Default-Landscape~ipad.png
new file mode 100644
index 0000000..6fe8925
Binary files /dev/null and b/resources/ios/splash/Default-Landscape~ipad.png differ
diff --git a/resources/ios/splash/Default-Portrait@2x~ipad.png b/resources/ios/splash/Default-Portrait@2x~ipad.png
new file mode 100644
index 0000000..3d06d86
Binary files /dev/null and b/resources/ios/splash/Default-Portrait@2x~ipad.png differ
diff --git a/resources/ios/splash/Default-Portrait~ipad.png b/resources/ios/splash/Default-Portrait~ipad.png
new file mode 100644
index 0000000..53ad4c4
Binary files /dev/null and b/resources/ios/splash/Default-Portrait~ipad.png differ
diff --git a/resources/ios/splash/Default@2x~iphone.png b/resources/ios/splash/Default@2x~iphone.png
new file mode 100644
index 0000000..6a13316
Binary files /dev/null and b/resources/ios/splash/Default@2x~iphone.png differ
diff --git a/resources/ios/splash/Default~iphone.png b/resources/ios/splash/Default~iphone.png
new file mode 100644
index 0000000..0aaad62
Binary files /dev/null and b/resources/ios/splash/Default~iphone.png differ
diff --git a/test/.jshintrc b/test/.jshintrc
new file mode 100644
index 0000000..97c8040
--- /dev/null
+++ b/test/.jshintrc
@@ -0,0 +1,35 @@
+{
+ "node": true,
+ "browser": true,
+ "esnext": true,
+ "bitwise": true,
+ "camelcase": true,
+ "curly": true,
+ "eqeqeq": true,
+ "immed": true,
+ "indent": 2,
+ "latedef": true,
+ "newcap": true,
+ "noarg": true,
+ "quotmark": "single",
+ "regexp": true,
+ "undef": true,
+ "unused": true,
+ "strict": true,
+ "trailing": true,
+ "smarttabs": true,
+ "globals": {
+ "after": false,
+ "afterEach": false,
+ "angular": false,
+ "before": false,
+ "beforeEach": false,
+ "browser": false,
+ "describe": false,
+ "expect": false,
+ "inject": false,
+ "it": false,
+ "jasmine": false,
+ "spyOn": false
+ }
+}
diff --git a/typings/angularjs/angular.d.ts b/typings/angularjs/angular.d.ts
new file mode 100644
index 0000000..8fd5743
--- /dev/null
+++ b/typings/angularjs/angular.d.ts
@@ -0,0 +1,1738 @@
+// Type definitions for Angular JS 1.4+
+// Project: http://angularjs.org
+// Definitions by: Diego Vilar
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+
+///
+
+declare var angular: angular.IAngularStatic;
+
+// Support for painless dependency injection
+interface Function {
+ $inject?: string[];
+}
+
+// Collapse angular into ng
+import ng = angular;
+// Support AMD require
+declare module 'angular' {
+ export = angular;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// ng module (angular.js)
+///////////////////////////////////////////////////////////////////////////////
+declare module angular {
+
+ // not directly implemented, but ensures that constructed class implements $get
+ interface IServiceProviderClass {
+ new (...args: any[]): IServiceProvider;
+ }
+
+ interface IServiceProviderFactory {
+ (...args: any[]): IServiceProvider;
+ }
+
+ // All service providers extend this interface
+ interface IServiceProvider {
+ $get: any;
+ }
+
+ interface IAngularBootstrapConfig {
+ strictDi?: boolean;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // AngularStatic
+ // see http://docs.angularjs.org/api
+ ///////////////////////////////////////////////////////////////////////////
+ interface IAngularStatic {
+ bind(context: any, fn: Function, ...args: any[]): Function;
+
+ /**
+ * Use this function to manually start up angular application.
+ *
+ * @param element DOM element which is the root of angular application.
+ * @param modules An array of modules to load into the application.
+ * Each item in the array should be the name of a predefined module or a (DI annotated)
+ * function that will be invoked by the injector as a run block.
+ * @param config an object for defining configuration options for the application. The following keys are supported:
+ * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code.
+ */
+ bootstrap(element: string, modules?: string, config?: IAngularBootstrapConfig): auto.IInjectorService;
+ /**
+ * Use this function to manually start up angular application.
+ *
+ * @param element DOM element which is the root of angular application.
+ * @param modules An array of modules to load into the application.
+ * Each item in the array should be the name of a predefined module or a (DI annotated)
+ * function that will be invoked by the injector as a run block.
+ * @param config an object for defining configuration options for the application. The following keys are supported:
+ * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code.
+ */
+ bootstrap(element: string, modules?: Function, config?: IAngularBootstrapConfig): auto.IInjectorService;
+ /**
+ * Use this function to manually start up angular application.
+ *
+ * @param element DOM element which is the root of angular application.
+ * @param modules An array of modules to load into the application.
+ * Each item in the array should be the name of a predefined module or a (DI annotated)
+ * function that will be invoked by the injector as a run block.
+ * @param config an object for defining configuration options for the application. The following keys are supported:
+ * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code.
+ */
+ bootstrap(element: string, modules?: string[], config?: IAngularBootstrapConfig): auto.IInjectorService;
+ /**
+ * Use this function to manually start up angular application.
+ *
+ * @param element DOM element which is the root of angular application.
+ * @param modules An array of modules to load into the application.
+ * Each item in the array should be the name of a predefined module or a (DI annotated)
+ * function that will be invoked by the injector as a run block.
+ * @param config an object for defining configuration options for the application. The following keys are supported:
+ * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code.
+ */
+ bootstrap(element: JQuery, modules?: string, config?: IAngularBootstrapConfig): auto.IInjectorService;
+ /**
+ * Use this function to manually start up angular application.
+ *
+ * @param element DOM element which is the root of angular application.
+ * @param modules An array of modules to load into the application.
+ * Each item in the array should be the name of a predefined module or a (DI annotated)
+ * function that will be invoked by the injector as a run block.
+ * @param config an object for defining configuration options for the application. The following keys are supported:
+ * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code.
+ */
+ bootstrap(element: JQuery, modules?: Function, config?: IAngularBootstrapConfig): auto.IInjectorService;
+ /**
+ * Use this function to manually start up angular application.
+ *
+ * @param element DOM element which is the root of angular application.
+ * @param modules An array of modules to load into the application.
+ * Each item in the array should be the name of a predefined module or a (DI annotated)
+ * function that will be invoked by the injector as a run block.
+ * @param config an object for defining configuration options for the application. The following keys are supported:
+ * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code.
+ */
+ bootstrap(element: JQuery, modules?: string[], config?: IAngularBootstrapConfig): auto.IInjectorService;
+ /**
+ * Use this function to manually start up angular application.
+ *
+ * @param element DOM element which is the root of angular application.
+ * @param modules An array of modules to load into the application.
+ * Each item in the array should be the name of a predefined module or a (DI annotated)
+ * function that will be invoked by the injector as a run block.
+ * @param config an object for defining configuration options for the application. The following keys are supported:
+ * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code.
+ */
+ bootstrap(element: Element, modules?: string, config?: IAngularBootstrapConfig): auto.IInjectorService;
+ /**
+ * Use this function to manually start up angular application.
+ *
+ * @param element DOM element which is the root of angular application.
+ * @param modules An array of modules to load into the application.
+ * Each item in the array should be the name of a predefined module or a (DI annotated)
+ * function that will be invoked by the injector as a run block.
+ * @param config an object for defining configuration options for the application. The following keys are supported:
+ * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code.
+ */
+ bootstrap(element: Element, modules?: Function, config?: IAngularBootstrapConfig): auto.IInjectorService;
+ /**
+ * Use this function to manually start up angular application.
+ *
+ * @param element DOM element which is the root of angular application.
+ * @param modules An array of modules to load into the application.
+ * Each item in the array should be the name of a predefined module or a (DI annotated)
+ * function that will be invoked by the injector as a run block.
+ * @param config an object for defining configuration options for the application. The following keys are supported:
+ * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code.
+ */
+ bootstrap(element: Element, modules?: string[], config?: IAngularBootstrapConfig): auto.IInjectorService;
+ /**
+ * Use this function to manually start up angular application.
+ *
+ * @param element DOM element which is the root of angular application.
+ * @param modules An array of modules to load into the application.
+ * Each item in the array should be the name of a predefined module or a (DI annotated)
+ * function that will be invoked by the injector as a run block.
+ * @param config an object for defining configuration options for the application. The following keys are supported:
+ * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code.
+ */
+ bootstrap(element: Document, modules?: string, config?: IAngularBootstrapConfig): auto.IInjectorService;
+ /**
+ * Use this function to manually start up angular application.
+ *
+ * @param element DOM element which is the root of angular application.
+ * @param modules An array of modules to load into the application.
+ * Each item in the array should be the name of a predefined module or a (DI annotated)
+ * function that will be invoked by the injector as a run block.
+ * @param config an object for defining configuration options for the application. The following keys are supported:
+ * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code.
+ */
+ bootstrap(element: Document, modules?: Function, config?: IAngularBootstrapConfig): auto.IInjectorService;
+ /**
+ * Use this function to manually start up angular application.
+ *
+ * @param element DOM element which is the root of angular application.
+ * @param modules An array of modules to load into the application.
+ * Each item in the array should be the name of a predefined module or a (DI annotated)
+ * function that will be invoked by the injector as a run block.
+ * @param config an object for defining configuration options for the application. The following keys are supported:
+ * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code.
+ */
+ bootstrap(element: Document, modules?: string[], config?: IAngularBootstrapConfig): auto.IInjectorService;
+
+ /**
+ * Creates a deep copy of source, which should be an object or an array.
+ *
+ * - If no destination is supplied, a copy of the object or array is created.
+ * - If a destination is provided, all of its elements (for array) or properties (for objects) are deleted and then all elements/properties from the source are copied to it.
+ * - If source is not an object or array (inc. null and undefined), source is returned.
+ * - If source is identical to 'destination' an exception will be thrown.
+ *
+ * @param source The source that will be used to make a copy. Can be any type, including primitives, null, and undefined.
+ * @param destination Destination into which the source is copied. If provided, must be of the same type as source.
+ */
+ copy(source: T, destination?: T): T;
+
+ /**
+ * Wraps a raw DOM element or HTML string as a jQuery element.
+ *
+ * If jQuery is available, angular.element is an alias for the jQuery function. If jQuery is not available, angular.element delegates to Angular's built-in subset of jQuery, called "jQuery lite" or "jqLite."
+ */
+ element: IAugmentedJQueryStatic;
+ equals(value1: any, value2: any): boolean;
+ extend(destination: any, ...sources: any[]): any;
+
+ /**
+ * Invokes the iterator function once for each item in obj collection, which can be either an object or an array. The iterator function is invoked with iterator(value, key), where value is the value of an object property or an array element and key is the object property key or array element index. Specifying a context for the function is optional.
+ *
+ * It is worth noting that .forEach does not iterate over inherited properties because it filters using the hasOwnProperty method.
+ *
+ * @param obj Object to iterate over.
+ * @param iterator Iterator function.
+ * @param context Object to become context (this) for the iterator function.
+ */
+ forEach(obj: T[], iterator: (value: T, key: number) => any, context?: any): any;
+ /**
+ * Invokes the iterator function once for each item in obj collection, which can be either an object or an array. The iterator function is invoked with iterator(value, key), where value is the value of an object property or an array element and key is the object property key or array element index. Specifying a context for the function is optional.
+ *
+ * It is worth noting that .forEach does not iterate over inherited properties because it filters using the hasOwnProperty method.
+ *
+ * @param obj Object to iterate over.
+ * @param iterator Iterator function.
+ * @param context Object to become context (this) for the iterator function.
+ */
+ forEach(obj: { [index: string]: T; }, iterator: (value: T, key: string) => any, context?: any): any;
+ /**
+ * Invokes the iterator function once for each item in obj collection, which can be either an object or an array. The iterator function is invoked with iterator(value, key), where value is the value of an object property or an array element and key is the object property key or array element index. Specifying a context for the function is optional.
+ *
+ * It is worth noting that .forEach does not iterate over inherited properties because it filters using the hasOwnProperty method.
+ *
+ * @param obj Object to iterate over.
+ * @param iterator Iterator function.
+ * @param context Object to become context (this) for the iterator function.
+ */
+ forEach(obj: any, iterator: (value: any, key: any) => any, context?: any): any;
+
+ fromJson(json: string): any;
+ identity(arg?: T): T;
+ injector(modules?: any[], strictDi?: boolean): auto.IInjectorService;
+ isArray(value: any): boolean;
+ isDate(value: any): boolean;
+ isDefined(value: any): boolean;
+ isElement(value: any): boolean;
+ isFunction(value: any): boolean;
+ isNumber(value: any): boolean;
+ isObject(value: any): boolean;
+ isString(value: any): boolean;
+ isUndefined(value: any): boolean;
+ lowercase(str: string): string;
+
+ /**
+ * Deeply extends the destination object dst by copying own enumerable properties from the src object(s) to dst. You can specify multiple src objects. If you want to preserve original objects, you can do so by passing an empty object as the target: var object = angular.merge({}, object1, object2).
+ *
+ * Unlike extend(), merge() recursively descends into object properties of source objects, performing a deep copy.
+ *
+ * @param dst Destination object.
+ * @param src Source object(s).
+ */
+ merge(dst: any, ...src: any[]): any;
+
+ /**
+ * The angular.module is a global place for creating, registering and retrieving Angular modules. All modules (angular core or 3rd party) that should be available to an application must be registered using this mechanism.
+ *
+ * When passed two or more arguments, a new module is created. If passed only one argument, an existing module (the name passed as the first argument to module) is retrieved.
+ *
+ * @param name The name of the module to create or retrieve.
+ * @param requires The names of modules this module depends on. If specified then new module is being created. If unspecified then the module is being retrieved for further configuration.
+ * @param configFn Optional configuration function for the module.
+ */
+ module(
+ name: string,
+ requires?: string[],
+ configFn?: Function): IModule;
+
+ noop(...args: any[]): void;
+ reloadWithDebugInfo(): void;
+ toJson(obj: any, pretty?: boolean): string;
+ uppercase(str: string): string;
+ version: {
+ full: string;
+ major: number;
+ minor: number;
+ dot: number;
+ codeName: string;
+ };
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Module
+ // see http://docs.angularjs.org/api/angular.Module
+ ///////////////////////////////////////////////////////////////////////////
+ interface IModule {
+ animation(name: string, animationFactory: Function): IModule;
+ animation(name: string, inlineAnnotatedFunction: any[]): IModule;
+ animation(object: Object): IModule;
+ /**
+ * Use this method to register work which needs to be performed on module loading.
+ *
+ * @param configFn Execute this function on module load. Useful for service configuration.
+ */
+ config(configFn: Function): IModule;
+ /**
+ * Use this method to register work which needs to be performed on module loading.
+ *
+ * @param inlineAnnotatedFunction Execute this function on module load. Useful for service configuration.
+ */
+ config(inlineAnnotatedFunction: any[]): IModule;
+ /**
+ * Register a constant service, such as a string, a number, an array, an object or a function, with the $injector. Unlike value it can be injected into a module configuration function (see config) and it cannot be overridden by an Angular decorator.
+ *
+ * @param name The name of the constant.
+ * @param value The constant value.
+ */
+ constant(name: string, value: any): IModule;
+ constant(object: Object): IModule;
+ /**
+ * The $controller service is used by Angular to create new controllers.
+ *
+ * This provider allows controller registration via the register method.
+ *
+ * @param name Controller name, or an object map of controllers where the keys are the names and the values are the constructors.
+ * @param controllerConstructor Controller constructor fn (optionally decorated with DI annotations in the array notation).
+ */
+ controller(name: string, controllerConstructor: Function): IModule;
+ /**
+ * The $controller service is used by Angular to create new controllers.
+ *
+ * This provider allows controller registration via the register method.
+ *
+ * @param name Controller name, or an object map of controllers where the keys are the names and the values are the constructors.
+ * @param controllerConstructor Controller constructor fn (optionally decorated with DI annotations in the array notation).
+ */
+ controller(name: string, inlineAnnotatedConstructor: any[]): IModule;
+ controller(object: Object): IModule;
+ /**
+ * Register a new directive with the compiler.
+ *
+ * @param name Name of the directive in camel-case (i.e. ngBind which will match as ng-bind)
+ * @param directiveFactory An injectable directive factory function.
+ */
+ directive(name: string, directiveFactory: IDirectiveFactory): IModule;
+ /**
+ * Register a new directive with the compiler.
+ *
+ * @param name Name of the directive in camel-case (i.e. ngBind which will match as ng-bind)
+ * @param directiveFactory An injectable directive factory function.
+ */
+ directive(name: string, inlineAnnotatedFunction: any[]): IModule;
+ directive(object: Object): IModule;
+ /**
+ * Register a service factory, which will be called to return the service instance. This is short for registering a service where its provider consists of only a $get property, which is the given service factory function. You should use $provide.factory(getFn) if you do not need to configure your service in a provider.
+ *
+ * @param name The name of the instance.
+ * @param $getFn The $getFn for the instance creation. Internally this is a short hand for $provide.provider(name, {$get: $getFn}).
+ */
+ factory(name: string, $getFn: Function): IModule;
+ /**
+ * Register a service factory, which will be called to return the service instance. This is short for registering a service where its provider consists of only a $get property, which is the given service factory function. You should use $provide.factory(getFn) if you do not need to configure your service in a provider.
+ *
+ * @param name The name of the instance.
+ * @param inlineAnnotatedFunction The $getFn for the instance creation. Internally this is a short hand for $provide.provider(name, {$get: $getFn}).
+ */
+ factory(name: string, inlineAnnotatedFunction: any[]): IModule;
+ factory(object: Object): IModule;
+ filter(name: string, filterFactoryFunction: Function): IModule;
+ filter(name: string, inlineAnnotatedFunction: any[]): IModule;
+ filter(object: Object): IModule;
+ provider(name: string, serviceProviderFactory: IServiceProviderFactory): IModule;
+ provider(name: string, serviceProviderConstructor: IServiceProviderClass): IModule;
+ provider(name: string, inlineAnnotatedConstructor: any[]): IModule;
+ provider(name: string, providerObject: IServiceProvider): IModule;
+ provider(object: Object): IModule;
+ /**
+ * Run blocks are the closest thing in Angular to the main method. A run block is the code which needs to run to kickstart the application. It is executed after all of the service have been configured and the injector has been created. Run blocks typically contain code which is hard to unit-test, and for this reason should be declared in isolated modules, so that they can be ignored in the unit-tests.
+ */
+ run(initializationFunction: Function): IModule;
+ /**
+ * Run blocks are the closest thing in Angular to the main method. A run block is the code which needs to run to kickstart the application. It is executed after all of the service have been configured and the injector has been created. Run blocks typically contain code which is hard to unit-test, and for this reason should be declared in isolated modules, so that they can be ignored in the unit-tests.
+ */
+ run(inlineAnnotatedFunction: any[]): IModule;
+ service(name: string, serviceConstructor: Function): IModule;
+ service(name: string, inlineAnnotatedConstructor: any[]): IModule;
+ service(object: Object): IModule;
+ /**
+ * Register a value service with the $injector, such as a string, a number, an array, an object or a function. This is short for registering a service where its provider's $get property is a factory function that takes no arguments and returns the value service.
+
+ Value services are similar to constant services, except that they cannot be injected into a module configuration function (see config) but they can be overridden by an Angular decorator.
+ *
+ * @param name The name of the instance.
+ * @param value The value.
+ */
+ value(name: string, value: any): IModule;
+ value(object: Object): IModule;
+
+ /**
+ * Register a service decorator with the $injector. A service decorator intercepts the creation of a service, allowing it to override or modify the behaviour of the service. The object returned by the decorator may be the original service, or a new service object which replaces or wraps and delegates to the original service.
+ * @param name The name of the service to decorate
+ * @param decorator This function will be invoked when the service needs to be instantiated and should return the decorated service instance. The function is called using the injector.invoke method and is therefore fully injectable. Local injection arguments: $delegate - The original service instance, which can be monkey patched, configured, decorated or delegated to.
+ */
+ decorator(name:string, decoratorConstructor: Function): IModule;
+ decorator(name:string, inlineAnnotatedConstructor: any[]): IModule;
+
+ // Properties
+ name: string;
+ requires: string[];
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Attributes
+ // see http://docs.angularjs.org/api/ng.$compile.directive.Attributes
+ ///////////////////////////////////////////////////////////////////////////
+ interface IAttributes {
+ /**
+ * this is necessary to be able to access the scoped attributes. it's not very elegant
+ * because you have to use attrs['foo'] instead of attrs.foo but I don't know of a better way
+ * this should really be limited to return string but it creates this problem: http://stackoverflow.com/q/17201854/165656
+ */
+ [name: string]: any;
+
+ /**
+ * Converts an attribute name (e.g. dash/colon/underscore-delimited string, optionally prefixed with x- or data-) to its normalized, camelCase form.
+ *
+ * Also there is special case for Moz prefix starting with upper case letter.
+ *
+ * For further information check out the guide on @see https://docs.angularjs.org/guide/directive#matching-directives
+ */
+ $normalize(name: string): void;
+
+ /**
+ * Adds the CSS class value specified by the classVal parameter to the
+ * element. If animations are enabled then an animation will be triggered
+ * for the class addition.
+ */
+ $addClass(classVal: string): void;
+
+ /**
+ * Removes the CSS class value specified by the classVal parameter from the
+ * element. If animations are enabled then an animation will be triggered for
+ * the class removal.
+ */
+ $removeClass(classVal: string): void;
+
+ /**
+ * Set DOM element attribute value.
+ */
+ $set(key: string, value: any): void;
+
+ /**
+ * Observes an interpolated attribute.
+ * The observer function will be invoked once during the next $digest
+ * following compilation. The observer is then invoked whenever the
+ * interpolated value changes.
+ */
+ $observe(name: string, fn: (value?: T) => any): Function;
+
+ /**
+ * A map of DOM element attribute names to the normalized name. This is needed
+ * to do reverse lookup from normalized name back to actual name.
+ */
+ $attr: Object;
+ }
+
+ /**
+ * form.FormController - type in module ng
+ * see https://docs.angularjs.org/api/ng/type/form.FormController
+ */
+ interface IFormController {
+
+ /**
+ * Indexer which should return ng.INgModelController for most properties but cannot because of "All named properties must be assignable to string indexer type" constraint - see https://github.com/Microsoft/TypeScript/issues/272
+ */
+ [name: string]: any;
+
+ $pristine: boolean;
+ $dirty: boolean;
+ $valid: boolean;
+ $invalid: boolean;
+ $submitted: boolean;
+ $error: any;
+ $addControl(control: INgModelController): void;
+ $removeControl(control: INgModelController): void;
+ $setValidity(validationErrorKey: string, isValid: boolean, control: INgModelController): void;
+ $setDirty(): void;
+ $setPristine(): void;
+ $commitViewValue(): void;
+ $rollbackViewValue(): void;
+ $setSubmitted(): void;
+ $setUntouched(): void;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // NgModelController
+ // see http://docs.angularjs.org/api/ng.directive:ngModel.NgModelController
+ ///////////////////////////////////////////////////////////////////////////
+ interface INgModelController {
+ $render(): void;
+ $setValidity(validationErrorKey: string, isValid: boolean): void;
+ // Documentation states viewValue and modelValue to be a string but other
+ // types do work and it's common to use them.
+ $setViewValue(value: any, trigger?: string): void;
+ $setPristine(): void;
+ $setDirty(): void;
+ $validate(): void;
+ $setTouched(): void;
+ $setUntouched(): void;
+ $rollbackViewValue(): void;
+ $commitViewValue(): void;
+ $isEmpty(value: any): boolean;
+
+ $viewValue: any;
+
+ $modelValue: any;
+
+ $parsers: IModelParser[];
+ $formatters: IModelFormatter[];
+ $viewChangeListeners: IModelViewChangeListener[];
+ $error: any;
+ $name: string;
+
+ $touched: boolean;
+ $untouched: boolean;
+
+ $validators: IModelValidators;
+ $asyncValidators: IAsyncModelValidators;
+
+ $pending: any;
+ $pristine: boolean;
+ $dirty: boolean;
+ $valid: boolean;
+ $invalid: boolean;
+ }
+
+ interface IModelValidators {
+ /**
+ * viewValue is any because it can be an object that is called in the view like $viewValue.name:$viewValue.subName
+ */
+ [index: string]: (modelValue: any, viewValue: any) => boolean;
+ }
+
+ interface IAsyncModelValidators {
+ [index: string]: (modelValue: any, viewValue: any) => IPromise;
+ }
+
+ interface IModelParser {
+ (value: any): any;
+ }
+
+ interface IModelFormatter {
+ (value: any): any;
+ }
+
+ interface IModelViewChangeListener {
+ (): void;
+ }
+
+ /**
+ * $rootScope - $rootScopeProvider - service in module ng
+ * see https://docs.angularjs.org/api/ng/type/$rootScope.Scope and https://docs.angularjs.org/api/ng/service/$rootScope
+ */
+ interface IRootScopeService {
+ [index: string]: any;
+
+ $apply(): any;
+ $apply(exp: string): any;
+ $apply(exp: (scope: IScope) => any): any;
+
+ $applyAsync(): any;
+ $applyAsync(exp: string): any;
+ $applyAsync(exp: (scope: IScope) => any): any;
+
+ /**
+ * Dispatches an event name downwards to all child scopes (and their children) notifying the registered $rootScope.Scope listeners.
+ *
+ * The event life cycle starts at the scope on which $broadcast was called. All listeners listening for name event on this scope get notified. Afterwards, the event propagates to all direct and indirect scopes of the current scope and calls all registered listeners along the way. The event cannot be canceled.
+ *
+ * Any exception emitted from the listeners will be passed onto the $exceptionHandler service.
+ *
+ * @param name Event name to broadcast.
+ * @param args Optional one or more arguments which will be passed onto the event listeners.
+ */
+ $broadcast(name: string, ...args: any[]): IAngularEvent;
+ $destroy(): void;
+ $digest(): void;
+ /**
+ * Dispatches an event name upwards through the scope hierarchy notifying the registered $rootScope.Scope listeners.
+ *
+ * The event life cycle starts at the scope on which $emit was called. All listeners listening for name event on this scope get notified. Afterwards, the event traverses upwards toward the root scope and calls all registered listeners along the way. The event will stop propagating if one of the listeners cancels it.
+ *
+ * Any exception emitted from the listeners will be passed onto the $exceptionHandler service.
+ *
+ * @param name Event name to emit.
+ * @param args Optional one or more arguments which will be passed onto the event listeners.
+ */
+ $emit(name: string, ...args: any[]): IAngularEvent;
+
+ $eval(): any;
+ $eval(expression: string, locals?: Object): any;
+ $eval(expression: (scope: IScope) => any, locals?: Object): any;
+
+ $evalAsync(): void;
+ $evalAsync(expression: string): void;
+ $evalAsync(expression: (scope: IScope) => any): void;
+
+ // Defaults to false by the implementation checking strategy
+ $new(isolate?: boolean, parent?: IScope): IScope;
+
+ /**
+ * Listens on events of a given type. See $emit for discussion of event life cycle.
+ *
+ * The event listener function format is: function(event, args...).
+ *
+ * @param name Event name to listen on.
+ * @param listener Function to call when the event is emitted.
+ */
+ $on(name: string, listener: (event: IAngularEvent, ...args: any[]) => any): Function;
+
+ $watch(watchExpression: string, listener?: string, objectEquality?: boolean): Function;
+ $watch(watchExpression: string, listener?: (newValue: T, oldValue: T, scope: IScope) => any, objectEquality?: boolean): Function;
+ $watch(watchExpression: (scope: IScope) => any, listener?: string, objectEquality?: boolean): Function;
+ $watch(watchExpression: (scope: IScope) => T, listener?: (newValue: T, oldValue: T, scope: IScope) => any, objectEquality?: boolean): Function;
+
+ $watchCollection(watchExpression: string, listener: (newValue: T, oldValue: T, scope: IScope) => any): Function;
+ $watchCollection(watchExpression: (scope: IScope) => T, listener: (newValue: T, oldValue: T, scope: IScope) => any): Function;
+
+ $watchGroup(watchExpressions: any[], listener: (newValue: any, oldValue: any, scope: IScope) => any): Function;
+ $watchGroup(watchExpressions: { (scope: IScope): any }[], listener: (newValue: any, oldValue: any, scope: IScope) => any): Function;
+
+ $parent: IScope;
+ $root: IRootScopeService;
+ $id: number;
+
+ // Hidden members
+ $$isolateBindings: any;
+ $$phase: any;
+ }
+
+ interface IScope extends IRootScopeService { }
+
+ /**
+ * $scope for ngRepeat directive.
+ * see https://docs.angularjs.org/api/ng/directive/ngRepeat
+ */
+ interface IRepeatScope extends IScope {
+
+ /**
+ * iterator offset of the repeated element (0..length-1).
+ */
+ $index: number;
+
+ /**
+ * true if the repeated element is first in the iterator.
+ */
+ $first: boolean;
+
+ /**
+ * true if the repeated element is between the first and last in the iterator.
+ */
+ $middle: boolean;
+
+ /**
+ * true if the repeated element is last in the iterator.
+ */
+ $last: boolean;
+
+ /**
+ * true if the iterator position $index is even (otherwise false).
+ */
+ $even: boolean;
+
+ /**
+ * true if the iterator position $index is odd (otherwise false).
+ */
+ $odd: boolean;
+
+ }
+
+ interface IAngularEvent {
+ /**
+ * the scope on which the event was $emit-ed or $broadcast-ed.
+ */
+ targetScope: IScope;
+ /**
+ * the scope that is currently handling the event. Once the event propagates through the scope hierarchy, this property is set to null.
+ */
+ currentScope: IScope;
+ /**
+ * name of the event.
+ */
+ name: string;
+ /**
+ * calling stopPropagation function will cancel further event propagation (available only for events that were $emit-ed).
+ */
+ stopPropagation?: Function;
+ /**
+ * calling preventDefault sets defaultPrevented flag to true.
+ */
+ preventDefault: Function;
+ /**
+ * true if preventDefault was called.
+ */
+ defaultPrevented: boolean;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // WindowService
+ // see http://docs.angularjs.org/api/ng.$window
+ ///////////////////////////////////////////////////////////////////////////
+ interface IWindowService extends Window {
+ [key: string]: any;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // BrowserService
+ // TODO undocumented, so we need to get it from the source code
+ ///////////////////////////////////////////////////////////////////////////
+ interface IBrowserService {
+ defer: angular.ITimeoutService;
+ [key: string]: any;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // TimeoutService
+ // see http://docs.angularjs.org/api/ng.$timeout
+ ///////////////////////////////////////////////////////////////////////////
+ interface ITimeoutService {
+ (delay?: number, invokeApply?: boolean): IPromise;
+ (fn: (...args: any[]) => T, delay?: number, invokeApply?: boolean, ...args: any[]): IPromise;
+ cancel(promise?: IPromise): boolean;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // IntervalService
+ // see http://docs.angularjs.org/api/ng.$interval
+ ///////////////////////////////////////////////////////////////////////////
+ interface IIntervalService {
+ (func: Function, delay: number, count?: number, invokeApply?: boolean): IPromise;
+ cancel(promise: IPromise): boolean;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // AngularProvider
+ // see http://docs.angularjs.org/api/ng/provider/$animateProvider
+ ///////////////////////////////////////////////////////////////////////////
+ interface IAnimateProvider {
+ /**
+ * Registers a new injectable animation factory function.
+ *
+ * @param name The name of the animation.
+ * @param factory The factory function that will be executed to return the animation object.
+ */
+ register(name: string, factory: () => IAnimateCallbackObject): void;
+
+ /**
+ * Gets and/or sets the CSS class expression that is checked when performing an animation.
+ *
+ * @param expression The className expression which will be checked against all animations.
+ * @returns The current CSS className expression value. If null then there is no expression value.
+ */
+ classNameFilter(expression?: RegExp): RegExp;
+ }
+
+ /**
+ * The animation object which contains callback functions for each event that is expected to be animated.
+ */
+ interface IAnimateCallbackObject {
+ eventFn(element: Node, doneFn: () => void): Function;
+ }
+
+ /**
+ * $filter - $filterProvider - service in module ng
+ *
+ * Filters are used for formatting data displayed to the user.
+ *
+ * see https://docs.angularjs.org/api/ng/service/$filter
+ */
+ interface IFilterService {
+ /**
+ * Usage:
+ * $filter(name);
+ *
+ * @param name Name of the filter function to retrieve
+ */
+ (name: string): Function;
+ }
+
+ /**
+ * $filterProvider - $filter - provider in module ng
+ *
+ * Filters are just functions which transform input to an output. However filters need to be Dependency Injected. To achieve this a filter definition consists of a factory function which is annotated with dependencies and is responsible for creating a filter function.
+ *
+ * see https://docs.angularjs.org/api/ng/provider/$filterProvider
+ */
+ interface IFilterProvider extends IServiceProvider {
+ /**
+ * register(name);
+ *
+ * @param name Name of the filter function, or an object map of filters where the keys are the filter names and the values are the filter factories. Note: Filter names must be valid angular Expressions identifiers, such as uppercase or orderBy. Names with special characters, such as hyphens and dots, are not allowed. If you wish to namespace your filters, then you can use capitalization (myappSubsectionFilterx) or underscores (myapp_subsection_filterx).
+ */
+ register(name: string | {}): IServiceProvider;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // LocaleService
+ // see http://docs.angularjs.org/api/ng.$locale
+ ///////////////////////////////////////////////////////////////////////////
+ interface ILocaleService {
+ id: string;
+
+ // These are not documented
+ // Check angular's i18n files for exemples
+ NUMBER_FORMATS: ILocaleNumberFormatDescriptor;
+ DATETIME_FORMATS: ILocaleDateTimeFormatDescriptor;
+ pluralCat: (num: any) => string;
+ }
+
+ interface ILocaleNumberFormatDescriptor {
+ DECIMAL_SEP: string;
+ GROUP_SEP: string;
+ PATTERNS: ILocaleNumberPatternDescriptor[];
+ CURRENCY_SYM: string;
+ }
+
+ interface ILocaleNumberPatternDescriptor {
+ minInt: number;
+ minFrac: number;
+ maxFrac: number;
+ posPre: string;
+ posSuf: string;
+ negPre: string;
+ negSuf: string;
+ gSize: number;
+ lgSize: number;
+ }
+
+ interface ILocaleDateTimeFormatDescriptor {
+ MONTH: string[];
+ SHORTMONTH: string[];
+ DAY: string[];
+ SHORTDAY: string[];
+ AMPMS: string[];
+ medium: string;
+ short: string;
+ fullDate: string;
+ longDate: string;
+ mediumDate: string;
+ shortDate: string;
+ mediumTime: string;
+ shortTime: string;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // LogService
+ // see http://docs.angularjs.org/api/ng.$log
+ // see http://docs.angularjs.org/api/ng.$logProvider
+ ///////////////////////////////////////////////////////////////////////////
+ interface ILogService {
+ debug: ILogCall;
+ error: ILogCall;
+ info: ILogCall;
+ log: ILogCall;
+ warn: ILogCall;
+ }
+
+ interface ILogProvider extends IServiceProvider {
+ debugEnabled(): boolean;
+ debugEnabled(enabled: boolean): ILogProvider;
+ }
+
+ // We define this as separate interface so we can reopen it later for
+ // the ngMock module.
+ interface ILogCall {
+ (...args: any[]): void;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // ParseService
+ // see http://docs.angularjs.org/api/ng.$parse
+ // see http://docs.angularjs.org/api/ng.$parseProvider
+ ///////////////////////////////////////////////////////////////////////////
+ interface IParseService {
+ (expression: string): ICompiledExpression;
+ }
+
+ interface IParseProvider {
+ logPromiseWarnings(): boolean;
+ logPromiseWarnings(value: boolean): IParseProvider;
+
+ unwrapPromises(): boolean;
+ unwrapPromises(value: boolean): IParseProvider;
+ }
+
+ interface ICompiledExpression {
+ (context: any, locals?: any): any;
+
+ // If value is not provided, undefined is gonna be used since the implementation
+ // does not check the parameter. Let's force a value for consistency. If consumer
+ // whants to undefine it, pass the undefined value explicitly.
+ assign(context: any, value: any): any;
+ }
+
+ /**
+ * $location - $locationProvider - service in module ng
+ * see https://docs.angularjs.org/api/ng/service/$location
+ */
+ interface ILocationService {
+ absUrl(): string;
+ hash(): string;
+ hash(newHash: string): ILocationService;
+ host(): string;
+
+ /**
+ * Return path of current url
+ */
+ path(): string;
+
+ /**
+ * Change path when called with parameter and return $location.
+ * Note: Path should always begin with forward slash (/), this method will add the forward slash if it is missing.
+ *
+ * @param path New path
+ */
+ path(path: string): ILocationService;
+
+ port(): number;
+ protocol(): string;
+ replace(): ILocationService;
+
+ /**
+ * Return search part (as object) of current url
+ */
+ search(): any;
+
+ /**
+ * Change search part when called with parameter and return $location.
+ *
+ * @param search When called with a single argument the method acts as a setter, setting the search component of $location to the specified value.
+ *
+ * If the argument is a hash object containing an array of values, these values will be encoded as duplicate search parameters in the url.
+ */
+ search(search: any): ILocationService;
+
+ /**
+ * Change search part when called with parameter and return $location.
+ *
+ * @param search New search params
+ * @param paramValue If search is a string or a Number, then paramValue will override only a single search property. If paramValue is null, the property specified via the first argument will be deleted. If paramValue is an array, it will override the property of the search component of $location specified via the first argument. If paramValue is true, the property specified via the first argument will be added with no value nor trailing equal sign.
+ */
+ search(search: string, paramValue: string|number|string[]|boolean): ILocationService;
+
+ state(): any;
+ state(state: any): ILocationService;
+ url(): string;
+ url(url: string): ILocationService;
+ }
+
+ interface ILocationProvider extends IServiceProvider {
+ hashPrefix(): string;
+ hashPrefix(prefix: string): ILocationProvider;
+ html5Mode(): boolean;
+
+ // Documentation states that parameter is string, but
+ // implementation tests it as boolean, which makes more sense
+ // since this is a toggler
+ html5Mode(active: boolean): ILocationProvider;
+ html5Mode(mode: { enabled?: boolean; requireBase?: boolean; rewriteLinks?: boolean; }): ILocationProvider;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // DocumentService
+ // see http://docs.angularjs.org/api/ng.$document
+ ///////////////////////////////////////////////////////////////////////////
+ interface IDocumentService extends IAugmentedJQuery {}
+
+ ///////////////////////////////////////////////////////////////////////////
+ // ExceptionHandlerService
+ // see http://docs.angularjs.org/api/ng.$exceptionHandler
+ ///////////////////////////////////////////////////////////////////////////
+ interface IExceptionHandlerService {
+ (exception: Error, cause?: string): void;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // RootElementService
+ // see http://docs.angularjs.org/api/ng.$rootElement
+ ///////////////////////////////////////////////////////////////////////////
+ interface IRootElementService extends JQuery {}
+
+ interface IQResolveReject {
+ (): void;
+ (value: T): void;
+ }
+ /**
+ * $q - service in module ng
+ * A promise/deferred implementation inspired by Kris Kowal's Q.
+ * See http://docs.angularjs.org/api/ng/service/$q
+ */
+ interface IQService {
+ new (resolver: (resolve: IQResolveReject) => any): IPromise;
+ new (resolver: (resolve: IQResolveReject, reject: IQResolveReject) => any): IPromise;
+ (resolver: (resolve: IQResolveReject) => any): IPromise;
+ (resolver: (resolve: IQResolveReject, reject: IQResolveReject) => any): IPromise;
+
+ /**
+ * Combines multiple promises into a single promise that is resolved when all of the input promises are resolved.
+ *
+ * Returns a single promise that will be resolved with an array of values, each value corresponding to the promise at the same index in the promises array. If any of the promises is resolved with a rejection, this resulting promise will be rejected with the same rejection value.
+ *
+ * @param promises An array of promises.
+ */
+ all(promises: IPromise[]): IPromise;
+ /**
+ * Combines multiple promises into a single promise that is resolved when all of the input promises are resolved.
+ *
+ * Returns a single promise that will be resolved with a hash of values, each value corresponding to the promise at the same key in the promises hash. If any of the promises is resolved with a rejection, this resulting promise will be rejected with the same rejection value.
+ *
+ * @param promises A hash of promises.
+ */
+ all(promises: { [id: string]: IPromise; }): IPromise<{ [id: string]: any; }>;
+ all(promises: { [id: string]: IPromise; }): IPromise;
+ /**
+ * Creates a Deferred object which represents a task which will finish in the future.
+ */
+ defer(): IDeferred;
+ /**
+ * Creates a promise that is resolved as rejected with the specified reason. This api should be used to forward rejection in a chain of promises. If you are dealing with the last promise in a promise chain, you don't need to worry about it.
+ *
+ * When comparing deferreds/promises to the familiar behavior of try/catch/throw, think of reject as the throw keyword in JavaScript. This also means that if you "catch" an error via a promise error callback and you want to forward the error to the promise derived from the current promise, you have to "rethrow" the error by returning a rejection constructed via reject.
+ *
+ * @param reason Constant, message, exception or an object representing the rejection reason.
+ */
+ reject(reason?: any): IPromise;
+ /**
+ * Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise. This is useful when you are dealing with an object that might or might not be a promise, or if the promise comes from a source that can't be trusted.
+ *
+ * @param value Value or a promise
+ */
+ when(value: IPromise|T): IPromise;
+ /**
+ * Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise. This is useful when you are dealing with an object that might or might not be a promise, or if the promise comes from a source that can't be trusted.
+ *
+ * @param value Value or a promise
+ */
+ when(): IPromise;
+ }
+
+ interface IPromise {
+ /**
+ * Regardless of when the promise was or will be resolved or rejected, then calls one of the success or error callbacks asynchronously as soon as the result is available. The callbacks are called with a single argument: the result or rejection reason. Additionally, the notify callback may be called zero or more times to provide a progress indication, before the promise is resolved or rejected.
+ * The successCallBack may return IPromise for when a $q.reject() needs to be returned
+ * This method returns a new promise which is resolved or rejected via the return value of the successCallback, errorCallback. It also notifies via the return value of the notifyCallback method. The promise can not be resolved or rejected from the notifyCallback method.
+ */
+ then(successCallback: (promiseValue: T) => IHttpPromise|IPromise|TResult|IPromise, errorCallback?: (reason: any) => any, notifyCallback?: (state: any) => any): IPromise;
+
+ /**
+ * Shorthand for promise.then(null, errorCallback)
+ */
+ catch(onRejected: (reason: any) => IHttpPromise|IPromise|TResult): IPromise;
+
+ /**
+ * Allows you to observe either the fulfillment or rejection of a promise, but to do so without modifying the final value. This is useful to release resources or do some clean-up that needs to be done whether the promise was rejected or resolved. See the full specification for more information.
+ *
+ * Because finally is a reserved word in JavaScript and reserved keywords are not supported as property names by ES3, you'll need to invoke the method like promise['finally'](callback) to make your code IE8 and Android 2.x compatible.
+ */
+ finally(finallyCallback: () => any): IPromise;
+ }
+
+ interface IDeferred {
+ resolve(value?: T): void;
+ reject(reason?: any): void;
+ notify(state?: any): void;
+ promise: IPromise;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // AnchorScrollService
+ // see http://docs.angularjs.org/api/ng.$anchorScroll
+ ///////////////////////////////////////////////////////////////////////////
+ interface IAnchorScrollService {
+ (): void;
+ (hash: string): void;
+ yOffset: any;
+ }
+
+ interface IAnchorScrollProvider extends IServiceProvider {
+ disableAutoScrolling(): void;
+ }
+
+ /**
+ * $cacheFactory - service in module ng
+ *
+ * Factory that constructs Cache objects and gives access to them.
+ *
+ * see https://docs.angularjs.org/api/ng/service/$cacheFactory
+ */
+ interface ICacheFactoryService {
+ /**
+ * Factory that constructs Cache objects and gives access to them.
+ *
+ * @param cacheId Name or id of the newly created cache.
+ * @param optionsMap Options object that specifies the cache behavior. Properties:
+ *
+ * capacity — turns the cache into LRU cache.
+ */
+ (cacheId: string, optionsMap?: { capacity?: number; }): ICacheObject;
+
+ /**
+ * Get information about all the caches that have been created.
+ * @returns key-value map of cacheId to the result of calling cache#info
+ */
+ info(): any;
+
+ /**
+ * Get access to a cache object by the cacheId used when it was created.
+ *
+ * @param cacheId Name or id of a cache to access.
+ */
+ get(cacheId: string): ICacheObject;
+ }
+
+ /**
+ * $cacheFactory.Cache - type in module ng
+ *
+ * A cache object used to store and retrieve data, primarily used by $http and the script directive to cache templates and other data.
+ *
+ * see https://docs.angularjs.org/api/ng/type/$cacheFactory.Cache
+ */
+ interface ICacheObject {
+ /**
+ * Retrieve information regarding a particular Cache.
+ */
+ info(): {
+ /**
+ * the id of the cache instance
+ */
+ id: string;
+
+ /**
+ * the number of entries kept in the cache instance
+ */
+ size: number;
+
+ //...: any additional properties from the options object when creating the cache.
+ };
+
+ /**
+ * Inserts a named entry into the Cache object to be retrieved later, and incrementing the size of the cache if the key was not already present in the cache. If behaving like an LRU cache, it will also remove stale entries from the set.
+ *
+ * It will not insert undefined values into the cache.
+ *
+ * @param key the key under which the cached data is stored.
+ * @param value the value to store alongside the key. If it is undefined, the key will not be stored.
+ */
+ put(key: string, value?: T): T;
+
+ /**
+ * Retrieves named data stored in the Cache object.
+ *
+ * @param key the key of the data to be retrieved
+ */
+ get(key: string): T;
+
+ /**
+ * Removes an entry from the Cache object.
+ *
+ * @param key the key of the entry to be removed
+ */
+ remove(key: string): void;
+
+ /**
+ * Clears the cache object of any entries.
+ */
+ removeAll(): void;
+
+ /**
+ * Destroys the Cache object entirely, removing it from the $cacheFactory set.
+ */
+ destroy(): void;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // CompileService
+ // see http://docs.angularjs.org/api/ng.$compile
+ // see http://docs.angularjs.org/api/ng.$compileProvider
+ ///////////////////////////////////////////////////////////////////////////
+ interface ICompileService {
+ (element: string, transclude?: ITranscludeFunction, maxPriority?: number): ITemplateLinkingFunction;
+ (element: Element, transclude?: ITranscludeFunction, maxPriority?: number): ITemplateLinkingFunction;
+ (element: JQuery, transclude?: ITranscludeFunction, maxPriority?: number): ITemplateLinkingFunction;
+ }
+
+ interface ICompileProvider extends IServiceProvider {
+ directive(name: string, directiveFactory: Function): ICompileProvider;
+
+ // Undocumented, but it is there...
+ directive(directivesMap: any): ICompileProvider;
+
+ aHrefSanitizationWhitelist(): RegExp;
+ aHrefSanitizationWhitelist(regexp: RegExp): ICompileProvider;
+
+ imgSrcSanitizationWhitelist(): RegExp;
+ imgSrcSanitizationWhitelist(regexp: RegExp): ICompileProvider;
+
+ debugInfoEnabled(enabled?: boolean): any;
+ }
+
+ interface ICloneAttachFunction {
+ // Let's hint but not force cloneAttachFn's signature
+ (clonedElement?: JQuery, scope?: IScope): any;
+ }
+
+ // This corresponds to the "publicLinkFn" returned by $compile.
+ interface ITemplateLinkingFunction {
+ (scope: IScope, cloneAttachFn?: ICloneAttachFunction): IAugmentedJQuery;
+ }
+
+ // This corresponds to $transclude (and also the transclude function passed to link).
+ interface ITranscludeFunction {
+ // If the scope is provided, then the cloneAttachFn must be as well.
+ (scope: IScope, cloneAttachFn: ICloneAttachFunction): IAugmentedJQuery;
+ // If one argument is provided, then it's assumed to be the cloneAttachFn.
+ (cloneAttachFn?: ICloneAttachFunction): IAugmentedJQuery;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // ControllerService
+ // see http://docs.angularjs.org/api/ng.$controller
+ // see http://docs.angularjs.org/api/ng.$controllerProvider
+ ///////////////////////////////////////////////////////////////////////////
+ interface IControllerService {
+ // Although the documentation doesn't state this, locals are optional
+ (controllerConstructor: Function, locals?: any, bindToController?: any): any;
+ (controllerName: string, locals?: any, bindToController?: any): any;
+ }
+
+ interface IControllerProvider extends IServiceProvider {
+ register(name: string, controllerConstructor: Function): void;
+ register(name: string, dependencyAnnotatedConstructor: any[]): void;
+ allowGlobals(): void;
+ }
+
+ /**
+ * HttpService
+ * see http://docs.angularjs.org/api/ng/service/$http
+ */
+ interface IHttpService {
+ /**
+ * Object describing the request to be made and how it should be processed.
+ */
+ (config: IRequestConfig): IHttpPromise;
+
+ /**
+ * Shortcut method to perform GET request.
+ *
+ * @param url Relative or absolute URL specifying the destination of the request
+ * @param config Optional configuration object
+ */
+ get(url: string, config?: IRequestShortcutConfig): IHttpPromise;
+
+ /**
+ * Shortcut method to perform DELETE request.
+ *
+ * @param url Relative or absolute URL specifying the destination of the request
+ * @param config Optional configuration object
+ */
+ delete(url: string, config?: IRequestShortcutConfig): IHttpPromise;
+
+ /**
+ * Shortcut method to perform HEAD request.
+ *
+ * @param url Relative or absolute URL specifying the destination of the request
+ * @param config Optional configuration object
+ */
+ head(url: string, config?: IRequestShortcutConfig): IHttpPromise;
+
+ /**
+ * Shortcut method to perform JSONP request.
+ *
+ * @param url Relative or absolute URL specifying the destination of the request
+ * @param config Optional configuration object
+ */
+ jsonp(url: string, config?: IRequestShortcutConfig): IHttpPromise;
+
+ /**
+ * Shortcut method to perform POST request.
+ *
+ * @param url Relative or absolute URL specifying the destination of the request
+ * @param data Request content
+ * @param config Optional configuration object
+ */
+ post(url: string, data: any, config?: IRequestShortcutConfig): IHttpPromise;
+
+ /**
+ * Shortcut method to perform PUT request.
+ *
+ * @param url Relative or absolute URL specifying the destination of the request
+ * @param data Request content
+ * @param config Optional configuration object
+ */
+ put(url: string, data: any, config?: IRequestShortcutConfig): IHttpPromise;
+
+ /**
+ * Shortcut method to perform PATCH request.
+ *
+ * @param url Relative or absolute URL specifying the destination of the request
+ * @param data Request content
+ * @param config Optional configuration object
+ */
+ patch(url: string, data: any, config?: IRequestShortcutConfig): IHttpPromise;
+
+ /**
+ * Runtime equivalent of the $httpProvider.defaults property. Allows configuration of default headers, withCredentials as well as request and response transformations.
+ */
+ defaults: IRequestConfig;
+
+ /**
+ * Array of config objects for currently pending requests. This is primarily meant to be used for debugging purposes.
+ */
+ pendingRequests: any[];
+ }
+
+ /**
+ * Object describing the request to be made and how it should be processed.
+ * see http://docs.angularjs.org/api/ng/service/$http#usage
+ */
+ interface IRequestShortcutConfig {
+ /**
+ * {Object.}
+ * Map of strings or objects which will be turned to ?key1=value1&key2=value2 after the url. If the value is not a string, it will be JSONified.
+ */
+ params?: any;
+
+ /**
+ * Map of strings or functions which return strings representing HTTP headers to send to the server. If the return value of a function is null, the header will not be sent.
+ */
+ headers?: any;
+
+ /**
+ * Name of HTTP header to populate with the XSRF token.
+ */
+ xsrfHeaderName?: string;
+
+ /**
+ * Name of cookie containing the XSRF token.
+ */
+ xsrfCookieName?: string;
+
+ /**
+ * {boolean|Cache}
+ * If true, a default $http cache will be used to cache the GET request, otherwise if a cache instance built with $cacheFactory, this cache will be used for caching.
+ */
+ cache?: any;
+
+ /**
+ * whether to to set the withCredentials flag on the XHR object. See [requests with credentials]https://developer.mozilla.org/en/http_access_control#section_5 for more information.
+ */
+ withCredentials?: boolean;
+
+ /**
+ * {string|Object}
+ * Data to be sent as the request message data.
+ */
+ data?: any;
+
+ /**
+ * {function(data, headersGetter)|Array.}
+ * Transform function or an array of such functions. The transform function takes the http request body and headers and returns its transformed (typically serialized) version.
+ */
+ transformRequest?: any;
+
+ /**
+ * {function(data, headersGetter)|Array.}
+ * Transform function or an array of such functions. The transform function takes the http response body and headers and returns its transformed (typically deserialized) version.
+ */
+ transformResponse?: any;
+
+ /**
+ * {number|Promise}
+ * Timeout in milliseconds, or promise that should abort the request when resolved.
+ */
+ timeout?: any;
+
+ /**
+ * See requestType.
+ */
+ responseType?: string;
+ }
+
+ /**
+ * Object describing the request to be made and how it should be processed.
+ * see http://docs.angularjs.org/api/ng/service/$http#usage
+ */
+ interface IRequestConfig extends IRequestShortcutConfig {
+ /**
+ * HTTP method (e.g. 'GET', 'POST', etc)
+ */
+ method: string;
+ /**
+ * Absolute or relative URL of the resource that is being requested.
+ */
+ url: string;
+ }
+
+ interface IHttpHeadersGetter {
+ (): { [name: string]: string; };
+ (headerName: string): string;
+ }
+
+ interface IHttpPromiseCallback {
+ (data: T, status: number, headers: IHttpHeadersGetter, config: IRequestConfig): void;
+ }
+
+ interface IHttpPromiseCallbackArg {
+ data?: T;
+ status?: number;
+ headers?: IHttpHeadersGetter;
+ config?: IRequestConfig;
+ statusText?: string;
+ }
+
+ interface IHttpPromise extends IPromise> {
+ success(callback: IHttpPromiseCallback): IHttpPromise;
+ error(callback: IHttpPromiseCallback): IHttpPromise;
+ then(successCallback: (response: IHttpPromiseCallbackArg) => IPromise|TResult, errorCallback?: (response: IHttpPromiseCallbackArg) => any): IPromise;
+ }
+
+ /**
+ * Object that controls the defaults for $http provider
+ * https://docs.angularjs.org/api/ng/service/$http#defaults
+ */
+ interface IHttpProviderDefaults {
+ cache?: boolean;
+ /**
+ * Transform function or an array of such functions. The transform function takes the http request body and
+ * headers and returns its transformed (typically serialized) version.
+ */
+ transformRequest?: ((data: any, headersGetter?: any) => any)|((data: any, headersGetter?: any) => any)[];
+ xsrfCookieName?: string;
+ xsrfHeaderName?: string;
+ withCredentials?: boolean;
+ headers?: {
+ common?: any;
+ post?: any;
+ put?: any;
+ patch?: any;
+ }
+ }
+
+ interface IHttpProvider extends IServiceProvider {
+ defaults: IHttpProviderDefaults;
+ interceptors: any[];
+ useApplyAsync(): boolean;
+ useApplyAsync(value: boolean): IHttpProvider;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // HttpBackendService
+ // see http://docs.angularjs.org/api/ng.$httpBackend
+ // You should never need to use this service directly.
+ ///////////////////////////////////////////////////////////////////////////
+ interface IHttpBackendService {
+ // XXX Perhaps define callback signature in the future
+ (method: string, url: string, post?: any, callback?: Function, headers?: any, timeout?: number, withCredentials?: boolean): void;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // InterpolateService
+ // see http://docs.angularjs.org/api/ng.$interpolate
+ // see http://docs.angularjs.org/api/ng.$interpolateProvider
+ ///////////////////////////////////////////////////////////////////////////
+ interface IInterpolateService {
+ (text: string, mustHaveExpression?: boolean, trustedContext?: string, allOrNothing?: boolean): IInterpolationFunction;
+ endSymbol(): string;
+ startSymbol(): string;
+ }
+
+ interface IInterpolationFunction {
+ (context: any): string;
+ }
+
+ interface IInterpolateProvider extends IServiceProvider {
+ startSymbol(): string;
+ startSymbol(value: string): IInterpolateProvider;
+ endSymbol(): string;
+ endSymbol(value: string): IInterpolateProvider;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // TemplateCacheService
+ // see http://docs.angularjs.org/api/ng.$templateCache
+ ///////////////////////////////////////////////////////////////////////////
+ interface ITemplateCacheService extends ICacheObject {}
+
+ ///////////////////////////////////////////////////////////////////////////
+ // SCEService
+ // see http://docs.angularjs.org/api/ng.$sce
+ ///////////////////////////////////////////////////////////////////////////
+ interface ISCEService {
+ getTrusted(type: string, mayBeTrusted: any): any;
+ getTrustedCss(value: any): any;
+ getTrustedHtml(value: any): any;
+ getTrustedJs(value: any): any;
+ getTrustedResourceUrl(value: any): any;
+ getTrustedUrl(value: any): any;
+ parse(type: string, expression: string): (context: any, locals: any) => any;
+ parseAsCss(expression: string): (context: any, locals: any) => any;
+ parseAsHtml(expression: string): (context: any, locals: any) => any;
+ parseAsJs(expression: string): (context: any, locals: any) => any;
+ parseAsResourceUrl(expression: string): (context: any, locals: any) => any;
+ parseAsUrl(expression: string): (context: any, locals: any) => any;
+ trustAs(type: string, value: any): any;
+ trustAsHtml(value: any): any;
+ trustAsJs(value: any): any;
+ trustAsResourceUrl(value: any): any;
+ trustAsUrl(value: any): any;
+ isEnabled(): boolean;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // SCEProvider
+ // see http://docs.angularjs.org/api/ng.$sceProvider
+ ///////////////////////////////////////////////////////////////////////////
+ interface ISCEProvider extends IServiceProvider {
+ enabled(value: boolean): void;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // SCEDelegateService
+ // see http://docs.angularjs.org/api/ng.$sceDelegate
+ ///////////////////////////////////////////////////////////////////////////
+ interface ISCEDelegateService {
+ getTrusted(type: string, mayBeTrusted: any): any;
+ trustAs(type: string, value: any): any;
+ valueOf(value: any): any;
+ }
+
+
+ ///////////////////////////////////////////////////////////////////////////
+ // SCEDelegateProvider
+ // see http://docs.angularjs.org/api/ng.$sceDelegateProvider
+ ///////////////////////////////////////////////////////////////////////////
+ interface ISCEDelegateProvider extends IServiceProvider {
+ resourceUrlBlacklist(blacklist: any[]): void;
+ resourceUrlWhitelist(whitelist: any[]): void;
+ resourceUrlBlacklist(): any[];
+ resourceUrlWhitelist(): any[];
+ }
+
+ /**
+ * $templateRequest service
+ * see http://docs.angularjs.org/api/ng/service/$templateRequest
+ */
+ interface ITemplateRequestService {
+ /**
+ * Downloads a template using $http and, upon success, stores the
+ * contents inside of $templateCache.
+ *
+ * If the HTTP request fails or the response data of the HTTP request is
+ * empty then a $compile error will be thrown (unless
+ * {ignoreRequestError} is set to true).
+ *
+ * @param tpl The template URL.
+ * @param ignoreRequestError Whether or not to ignore the exception
+ * when the request fails or the template is
+ * empty.
+ *
+ * @return A promise whose value is the template content.
+ */
+ (tpl: string, ignoreRequestError?: boolean): IPromise;
+ /**
+ * total amount of pending template requests being downloaded.
+ * @type {number}
+ */
+ totalPendingRequests: number;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Directive
+ // see http://docs.angularjs.org/api/ng.$compileProvider#directive
+ // and http://docs.angularjs.org/guide/directive
+ ///////////////////////////////////////////////////////////////////////////
+
+ interface IDirectiveFactory {
+ (...args: any[]): IDirective;
+ }
+
+ interface IDirectiveLinkFn {
+ (
+ scope: IScope,
+ instanceElement: IAugmentedJQuery,
+ instanceAttributes: IAttributes,
+ controller: {},
+ transclude: ITranscludeFunction
+ ): void;
+ }
+
+ interface IDirectivePrePost {
+ pre?: IDirectiveLinkFn;
+ post?: IDirectiveLinkFn;
+ }
+
+ interface IDirectiveCompileFn {
+ (
+ templateElement: IAugmentedJQuery,
+ templateAttributes: IAttributes,
+ transclude: ITranscludeFunction
+ ): IDirectivePrePost;
+ }
+
+ interface IDirective {
+ compile?: IDirectiveCompileFn;
+ controller?: any;
+ controllerAs?: string;
+ bindToController?: boolean|Object;
+ link?: IDirectiveLinkFn | IDirectivePrePost;
+ name?: string;
+ priority?: number;
+ replace?: boolean;
+ require?: any;
+ restrict?: string;
+ scope?: any;
+ template?: any;
+ templateUrl?: any;
+ terminal?: boolean;
+ transclude?: any;
+ }
+
+ /**
+ * angular.element
+ * when calling angular.element, angular returns a jQuery object,
+ * augmented with additional methods like e.g. scope.
+ * see: http://docs.angularjs.org/api/angular.element
+ */
+ interface IAugmentedJQueryStatic extends JQueryStatic {
+ (selector: string, context?: any): IAugmentedJQuery;
+ (element: Element): IAugmentedJQuery;
+ (object: {}): IAugmentedJQuery;
+ (elementArray: Element[]): IAugmentedJQuery;
+ (object: JQuery): IAugmentedJQuery;
+ (func: Function): IAugmentedJQuery;
+ (array: any[]): IAugmentedJQuery;
+ (): IAugmentedJQuery;
+ }
+
+ interface IAugmentedJQuery extends JQuery {
+ // TODO: events, how to define?
+ //$destroy
+
+ find(selector: string): IAugmentedJQuery;
+ find(element: any): IAugmentedJQuery;
+ find(obj: JQuery): IAugmentedJQuery;
+ controller(): any;
+ controller(name: string): any;
+ injector(): any;
+ scope(): IScope;
+ isolateScope(): IScope;
+
+ inheritedData(key: string, value: any): JQuery;
+ inheritedData(obj: { [key: string]: any; }): JQuery;
+ inheritedData(key?: string): any;
+ }
+
+ ///////////////////////////////////////////////////////////////////////
+ // AnimateService
+ // see http://docs.angularjs.org/api/ng.$animate
+ ///////////////////////////////////////////////////////////////////////
+ interface IAnimateService {
+ addClass(element: JQuery, className: string, done?: Function): IPromise;
+ enter(element: JQuery, parent: JQuery, after: JQuery, done?: Function): void;
+ leave(element: JQuery, done?: Function): void;
+ move(element: JQuery, parent: JQuery, after: JQuery, done?: Function): void;
+ removeClass(element: JQuery, className: string, done?: Function): void;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // AUTO module (angular.js)
+ ///////////////////////////////////////////////////////////////////////////
+ export module auto {
+
+ ///////////////////////////////////////////////////////////////////////
+ // InjectorService
+ // see http://docs.angularjs.org/api/AUTO.$injector
+ ///////////////////////////////////////////////////////////////////////
+ interface IInjectorService {
+ annotate(fn: Function): string[];
+ annotate(inlineAnnotatedFunction: any[]): string[];
+ get(name: string): T;
+ has(name: string): boolean;
+ instantiate(typeConstructor: Function, locals?: any): T;
+ invoke(inlineAnnotatedFunction: any[]): any;
+ invoke(func: Function, context?: any, locals?: any): any;
+ }
+
+ ///////////////////////////////////////////////////////////////////////
+ // ProvideService
+ // see http://docs.angularjs.org/api/AUTO.$provide
+ ///////////////////////////////////////////////////////////////////////
+ interface IProvideService {
+ // Documentation says it returns the registered instance, but actual
+ // implementation does not return anything.
+ // constant(name: string, value: any): any;
+ /**
+ * Register a constant service, such as a string, a number, an array, an object or a function, with the $injector. Unlike value it can be injected into a module configuration function (see config) and it cannot be overridden by an Angular decorator.
+ *
+ * @param name The name of the constant.
+ * @param value The constant value.
+ */
+ constant(name: string, value: any): void;
+
+ /**
+ * Register a service decorator with the $injector. A service decorator intercepts the creation of a service, allowing it to override or modify the behaviour of the service. The object returned by the decorator may be the original service, or a new service object which replaces or wraps and delegates to the original service.
+ *
+ * @param name The name of the service to decorate.
+ * @param decorator This function will be invoked when the service needs to be instantiated and should return the decorated service instance. The function is called using the injector.invoke method and is therefore fully injectable. Local injection arguments:
+ *
+ * $delegate - The original service instance, which can be monkey patched, configured, decorated or delegated to.
+ */
+ decorator(name: string, decorator: Function): void;
+ /**
+ * Register a service decorator with the $injector. A service decorator intercepts the creation of a service, allowing it to override or modify the behaviour of the service. The object returned by the decorator may be the original service, or a new service object which replaces or wraps and delegates to the original service.
+ *
+ * @param name The name of the service to decorate.
+ * @param inlineAnnotatedFunction This function will be invoked when the service needs to be instantiated and should return the decorated service instance. The function is called using the injector.invoke method and is therefore fully injectable. Local injection arguments:
+ *
+ * $delegate - The original service instance, which can be monkey patched, configured, decorated or delegated to.
+ */
+ decorator(name: string, inlineAnnotatedFunction: any[]): void;
+ factory(name: string, serviceFactoryFunction: Function): IServiceProvider;
+ factory(name: string, inlineAnnotatedFunction: any[]): IServiceProvider;
+ provider(name: string, provider: IServiceProvider): IServiceProvider;
+ provider(name: string, serviceProviderConstructor: Function): IServiceProvider;
+ service(name: string, constructor: Function): IServiceProvider;
+ value(name: string, value: any): IServiceProvider;
+ }
+
+ }
+}