Created: 24.06.2016
By: Ionic Material Design Team
Email: ionicmaterialdesign@gmail.com
Thank you for purchasing Ionic Material Design. If you have any questions that are beyond the scope of this help file, please feel free to email via my user page contact form here. Thanks so much!

Ionic Material Design is mobile application that developed by Ionic Framework under the design concept of Google Material Design including the functions of ngCorgova. The application will present the function of :
We hope Ionic Material Design will help you gain idea to developing your application and decrease your development period.
This document cover : Introduction of Project, Important Notes, File & Folder Structure, Installation guide, HTML Files and Structure, CSS Files and Structure, Javascript Files and Structure, Configuration, Component Detail, Known Issues, Compatibility, Support, Useful Resources, Sources and Credits, Version History. We encourage you to deeply read this document. If you have any difficulties. Please contact us at ionicmaterialdesign@gmail.com or via my user page contact form here.
First of all when you extract files from a zip package you will found below directory :
This folder is a default file & folder structure of ionic framework, And place of Project Ionic Material Design please user below detail to access the HTML, CSS, JavaScript, Configuration file.
You will found file index.html : This is a documentation file.
You will found information about project files and documentation directory.
To run this Ionic Material Design project you have to install Ionic Framework by follow this step:
First, install LTS Mature and Dependable Version Node.js ( Do not use Stable Latest Features Version, Some of cordova plugin will not work 100% and you will lag with plugin issue). Then Downloading Ionic and installing all necessary
dependencies for development by
open a new cmd.exe for windows or Terminal for
mac and run :
npm install -g cordova
npm install -g ionic
sudo npm install -g cordova
sudo npm install -g ionic
Follow the
Android
and iOS
platform guides to install required platform dependencies.
More: Getting Started with Ionic
Install Android SDK :
To build locally using cordova-plugin-admobpro, to avoid build error, you need install some extras in Android SDK manager (type android sdk to launch it): Ref:
AdMob Pro Installation .
This is the installation step :








For Mac OS El Capitan
You will found the issue of cordova when add platform then it will get failed return (cordova keeps a cached version in your ${HOME}/.cordova folder.).
Reference from Ionicframework Forum Add platform ios failed,
However to fix this issue please following below steps.
Open a new Terminal and run :
rm -rf ~/.cordova
After you extract files from a zip package. Move Folder IonicMaterialDesign to your local computer directory path.
To run project on IOS / Android you need to add ionic platform by following steps.
Open a new cmd.exe for windows or Terminal for mac and run :
cd your_project_path/IonicMaterialDesign
ionic platform add ios
ionic platform add android
Ionic Framework will add platform to project for Build, Deploy or Emulate Application.
You have to install below plugin for let the project work.
Open a new cmd.exe for windows or Terminal for mac.
Set 1
cd your_project_path/IonicMaterialDesign
ionic plugin add cordova-plugin-statusbar
ionic plugin add cordova-plugin-contacts
ionic plugin add cordova-plugin-camera
ionic plugin add cordova-plugin-vibration
ionic plugin add cordova-plugin-device
ionic plugin add cordova-plugin-console
ionic plugin add cordova-plugin-transport-security
ionic plugin add cordova-plugin-inappbrowser
ionic plugin add cordova-plugin-splashscreen
ionic plugin add cordova-plugin-admobpro
Set 2
ionic plugin add cordova-plugin-x-socialsharing
ionic plugin add cordova-plugin-email-composer
ionic plugin add ionic-plugin-keyboard
ionic plugin add cordova-sms-plugin
ionic plugin add https://github.com/apache/cordova-plugin-whitelist.git
ionic plugin add https://github.com/devgeeks/Canvas2ImagePlugin.git
ionic plugin add https://github.com/wymsee/cordova-imagePicker.git
ionic plugin add https://github.com/litehelpers/Cordova-sqlite-storage.git#0.7.14
ionic plugin add https://github.com/EddyVerbruggen/Flashlight-PhoneGap-Plugin
ionic plugin add https://github.com/katzer/cordova-plugin-local-notifications
Now your project is ready to run.
Crosswalk is an open source project that allows you to specify a version of Chrome to use as your web browser in
Android. The compiled app will have your code hosted inside of this Chrome webview. Performancr will
better than devise browser. You can find mor information at Ionic Crosswalk
Open a new cmd.exe for windows or Terminal for mac.
cd your_project_path/IonicMaterialDesign
ionic browser add crosswalk
Now your project is ready for Crosswalk.
Use ionic serve -l to start a local development and run on browser.
Open a new cmd.exe for windows or Terminal for
mac and run :
cd your_project_path/IonicMaterialDesign
ionic serve -l
You can debug on browser by :
To build project to android platform you have to install android and java runtime to your computer by following
instruction of :
Ionic Framework walkthrough installing Cordova, Android
Or Youtube walkthrough of Ionic Framework channel : Youtube
walkthrough on installing Cordova, Android
After install success to build android you have to follow this step:
Open a new cmd.exe for windows or Terminal for
mac and run :
cd your_project_path/IonicMaterialDesign
ionic build android
cd your_project_path/IonicMaterialDesign
ionic build ios
To install this Ionic Material Design project to your Android device you have to follow this step:
Open a new cmd.exe for windows or Terminal for
mac and run :
cd your_project_path/IonicMaterialDesign
ionic run android
Important : You have to installing Cordova, Android to your computer.
To install this Ionic Material Design project to your IOS device you have to follow this step:
cd your_project_path/IonicMaterialDesign
ionic build ios
Note : You have to connect ios device to computer before run command.
Ionic Material Design use Powerfull tool Ionic Sass
for default css file.
Directory : project_path/scss :
You have to install gulpjs is required for run sass by :
open a new cmd.exe for windows or Terminal for
mac and run :
cd your_project_path
npm install gulp
ionic setup sass
Note: After you success sass setup. It will change css reference at index.html (head section). You Need to manual set it back. by add below code to index.html file at head section
<link rel="stylesheet" href="css/ionic.app.css">
<link rel="stylesheet" href="css/style.css">
...
After save file style.scss file nodejs will convert to css file at path www/css/style.css. We reference style.css at www/index.html
Important:
To convert file scss to css file you need to run ionic server for start gup task :
Open a new cmd.exe for windows or Terminal for
mac and run :
cd your_project_path/IonicMaterialDesign
ionic serve -l
To change Application Icon and Splash Screen Ionic Framework have tool for create it to all device size and platform by following step.
Orientation
preference
config is set to either landscape or portrait mode, then only the
necessary images will be generated.
cd your_project_path/IonicMaterialDesign
ionic resources
Learn More : Icon and Splash Screen
Please follow below step to update project for the latest version of Ionic Material Design.
You have to uninstall all plugin from your project and install it again by using below upgrade procedure :
cd your_project_path/IonicMaterialDesign ionic platform remove android ionic platform remove ios
cd your_project_path/IonicMaterialDesign ionic plugin remove cordova-plugin-googleplayservices ionic plugin remove com.cordova.plugins.sms ionic plugin remove com.synconset.imagepicker ionic plugin remove org.apache.cordova.splashscreen ionic plugin remove cordova-plugin-admob ionic plugin remove cordova-plugin-camera ionic plugin remove cordova-plugin-console ionic plugin remove cordova-plugin-contacts ionic plugin remove cordova-plugin-flashlight ionic plugin remove cordova-plugin-inappbrowser ionic plugin remove cordova-plugin-splashscreen ionic plugin remove cordova-plugin-transport-security ionic plugin remove cordova-plugin-vibration ionic plugin remove cordova-plugin-whitelist ionic plugin remove cordova-plugin-x-socialsharing ionic plugin remove cordova-sqlite-storage ionic plugin remove de.appplant.cordova.plugin.email-composer ionic plugin remove de.appplant.cordova.plugin.local-notification ionic plugin remove ionic-plugin-keyboard ionic plugin remove org.devgeeks.Canvas2ImagePlugin ionic plugin remove com.google.admobsdk ionic plugin remove cordova-plugin-app-event ionic plugin remove cordova-plugin-crosswalk-webview ionic plugin remove cordova-plugin-admobpro ionic plugin remove cordova-plugin-email-composer ionic plugin remove cordova-plugin-extension ionic plugin remove cordova-plugin-image-picker ionic plugin remove cordova-plugin-device ionic plugin remove cordova-plugin-statusbar


Please find HTML structure of Ionic Material Design :
<!--This is a main HTML file of project default page when application start.-->
<!--All reference of css and javascript lib is here.-->
<!DOCTYPE html>
<html>
<!--head section This is a place of all reference of css and javascript lib-->
<head>
<!-- Meta section -->
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<meta name="format-detection" content="telephone=no"> <!-- To disable phone number typing.-->
<!-- end Meta section -->
<title></title>
<!-- Font reference section -->
<link href="lib/robotodraft/robotodraft.css">
<!-- end Font reference section -->
<!-- CSS reference section -->
<link rel="stylesheet" href="css/ionic.app.css">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet prefetch" href="lib/angular-material/angular-material.css">
<link rel="stylesheet" href="lib/font-awesome-4.4.0/css/font-awesome.css">
<!-- end CSS reference section -->
<!-- Ionic javascript lib -->
<script src="lib/ionic/js/ionic.bundle.js"></script>
<!-- end Ionic javascript lib -->
<!-- Angular javascript lib -->
<script src="lib/angular-messages/angular-messages.js"></script>
<script src="lib/angular-aria/angular-aria.js"></script>
<script src="lib/angular-material/angular-material.js"></script>
<!-- end Angular javascript lib -->
<!-- Cordova script (this will be a 404 during development) -->
<script src="lib/ngCordova/dist/ng-cordova.js"></script>
<script src="cordova.js"></script>
<!-- end Cordova script -->
<!--ionic framework ngIOS9UIWebViewPatch-->
<!--Learn more about ngIOS9UIWebViewPatch at : http://blog.ionic.io/ios-9-potential-breaking-change/-->
<script src="lib/ngIOS9UIWebViewPatch/angular-ios9-uiwebview.patch.js"></script>
<!--end ionic framework ngIOS9UIWebViewPatch-->
<!-- app.js section-->
<script src="js/app.js"></script>
<!-- end app.js section-->
<!-- Controllers section-->
<script src="js/controllers.js"></script>
<script src="js/shared/directives.js"></script>
<script src="js/shared/filter.js"></script>
<script src="js/shared/controllers.js"></script>
<script src="templates/menu/js/controllers.js"></script>
<script src="templates/material-user-interface/dashboard/js/controllers.js"></script>
<script src="templates/application-storage/sqLite/js/controllers.js"></script>
<script src="templates/application-storage/sqLite/js/services.js"></script>
<script src="templates/application-storage/local-application-db/js/controllers.js"></script>
<script src="templates/application-storage/local-application-db/js/services.js"></script>
<script src="templates/social-network-connect/facebook/js/controllers.js"></script>
<script src="templates/social-network-connect/instagram/js/controllers.js"></script>
<script src="templates/social-network-connect/google-plus/js/controllers.js"></script>
<script src="templates/social-network-connect/foursquare/js/controllers.js"></script>
<script src="templates/social-network-connect/dropbox/js/controllers.js"></script>
<script src="templates/share-application-content/social-share/js/controllers.js"></script>
<script src="templates/share-application-content/email-message/js/controllers.js"></script>
<script src="templates/hardware-connect/device-information/js/controllers.js"></script>
<script src="templates/hardware-connect/mobile-contract/js/controllers.js"></script>
<script src="templates/hardware-connect/flash-light/js/controllers.js"></script>
<script src="templates/hardware-connect/vibration/js/controllers.js"></script>
<script src="templates/advertising-application/googleAdmob/js/controllers.js"></script>
<script src="templates/hardware-connect/image-picker/js/controllers.js"></script>
<script src="templates/social-network-connect/wordpress/js/controllers.js"></script>
<script src="templates/material-user-interface/dashboard/js/controllers.js"></script>
<script src="templates/material-user-interface/default-user-interface/js/controllers.js"></script>
<script src="templates/themes/menu-dashboard/js/controllers.js"></script>
<script src="templates/themes/expense-dashboard/js/controllers.js"></script>
<script src="templates/themes/catalog/js/controllers.js"></script>
<script src="templates/push-notification/single-push-notification/js/controllers.js"></script>
<script src="templates/push-notification/schedule-push-notification/js/controllers.js"></script>
<!-- end Controllers section-->
<!-- jQuery section-->
<script src="lib/jQuery/jquery.js"></script>
<!-- end jQuery section-->
</head><!-- end head section-->
<!--body section-->
<body ng-app="starter" class="hide-native-scroll-y">
<!--Custom Style section-->
<style type="text/css">
{{customStyle}}
</style><!-- end Custom Style section-->
<!-- Ionic navigation bar section-->
<ion-nav-view></ion-nav-view>
<!-- end Ionic navigation bar section-->
</body><!-- end body section-->
<!-- Angular custom template section-->
<!--Share template confirm-dialog section-->
<script type="text/ng-template" id="confirm-dialog.html">
<md-dialog aria-label="confirm-dialog">
<form>
<md-dialog-content>
<div>
<h2 class="md-title">{{displayOption.title}}</h2>
<p>{{displayOption.content}}</p>
</div>
</md-dialog-content>
<div class="md-actions" layout="row">
<a class="md-primary-color dialog-action-btn" ng-click="cancel()">
{{displayOption.cancel}}
</a>
<a class="md-primary-color dialog-action-btn" ng-click="ok()">
{{displayOption.ok}}
</a>
</div>
</form>
</md-dialog>
</script> <!-- end share template confirm-dialog section-->
<!-- Share template toast section-->
<script type="text/ng-template" id="toast.html">
<md-toast class="toast-form">
<span flex>{{displayOption.title}}</span>
</md-toast>
</script><!-- end share template toast section-->
<!-- end Angular custom template section-->
</html>
This is a sample
All section of html will have label section name, ID that reference to css. If you would like to edit
you
can open projectPath/scss/style.scss
then find id of reference and edit it.
Ionic Material Design use css library as below :
This project use Ionic Sass to create default CSS file . You can go to Sass Setup Section to setup sass.
If you would like to edit default CSS of project. Open style.scss file at path scss/style.scss you will found a section of :
//global variable section
//colors variable section
$color_white: white;
$color_gray: gray;
$color_alto: #dbdbdb;
$color_black: black;
$color_mercury: #e5e5e5;
$color_black_14: rgba(0, 0, 0, 0.14);
$color_black_12: rgba(0, 0, 0, 0.12);
$color_black_20: rgba(0, 0, 0, 0.2);
$color_black_084: rgba(0, 0, 0, 0.084);
$color_black_098: rgba(0, 0, 0, 0.098);
$color_black_haze_approx: #f6f6f6;
$color_angular: #E15258;
$color_ionic: #3079AB;
$color_material: #E59A13;
$color_ios: #45AFA8;
$color_facebook: #3c5c99;
$color_google_plus: #d73d32;
$color_instagram: #517fa4;
$color_foursquare: #f94777;
$color_dropbox: #017ee6;
$color_wordoress: #0087BE;
$color_romance_approx: #fefefe;
$color_alabaster: #fafafa;
$color_gondola_40_approx: rgba(34, 25, 25, 0.4);
$color_celeste_approx: #ccc;
$color_mine_shaft_approx: #333;
$color_carnation_approx: #ff5252;
$color_chenin_approx: #e3cf7a;
$color_red_orange_approx: #f44336;
$color_border_under_line: rgba(0, 0, 0, 0.12);
$color_md_tabs_border: #E1E1E1;
$color_md-whiteframe: #fff;
$color_border_menu_dashboard: rgba(225, 225, 225, 0.69);
$color_news_header: #2882D8;
//fonts variable section
$font_roboto_draft: RobotoDraft;
$font_roboto: Roboto;
$font_helvetica_neue: Helvetica Neue;
$font_sans-serif: sans-serif;
$font_arial: Arial;
//urls variable section
$url_background_cover_pixels: url(../img/background_cover_pixels.png);
$url_background_cover_contract_us: url(../img/contract_us_bg.jpg);
$url_background_cover_try_app_01: url(../img/slide_01.png);
$url_background_cover_try_app_02: url(../img/slide_02.png);
$url_background_cover_try_app_03: url(../img/slide_03.png);
$url_background_cover_try_app_04: url(../img/slide_04.png);
$url_background_cover_try_app_05: url(../img/slide_05.png);
$url_background_cover_try_app_06: url(../img/slide_06.png);
$url_background_cover_try_app_07: url(../img/slide_07.png);
$url_background_cover_try_app_08: url(../img/slide_08.png);
$url_background_cover_restaurant_01: url(../img/food_01.png);
$url_background_cover_restaurant_02: url(../img/food_02.png);
$url_background_cover_restaurant_03: url(../img/food_03.png);
//end global variable section
//global class section
If you would like to edit a specific section of the site, simply find the appropriate label, section, ID in
the CSS file, and then scroll down until you find the appropriate style that needs to be edited.
This project use Ionic Framework Grid System.
If you would like to create or edit layout you can use Column Percentage Class names for view
layout by using this structure :
.col.col-50.col.col.col.col-75.col.col.col.col-75.col.col
Learn more about: Ionic Framework Grid System.
This application imports three Javascript files.
//
//Welcome to app.js
//This is main application config of project. You can change a setting of :
// - Global Variable
// - Theme setting
// - Icon setting
// - Register View
// - Spinner setting
// - Custom style
//
//global variable use for setting color, start page, message, oAuth key.
var db = null; //Use for SQLite database.
window.globalVariable = {
color: {//custom color style variable
appPrimaryColor: "",
dropboxColor: "#017EE6",
facebookColor: "#3C5C99",
foursquareColor: "#F94777",
googlePlusColor: "#D73D32",
instagramColor: "#517FA4",
wordpressColor: "#0087BE"
},//end custom color style variable
startPage: {
url: "/app/dashboard", //Url of start page.
state: "app.dashboard"//State name of start page.
},
message: {
errorMessage: "Technical error please try again later." //Default error message.
},
oAuth: {
dropbox: "xxx-xxx-xxx", //Use for Dropbox API clientID.
facebook: "xxx-xxx-xxx", //Use for Facebook API clientID.
foursquare: "xxx-xxx-xxx", //Use for Foursquare API clientID.
instagram: "xxx-xxx-xxx", //Use for Instagram API clientID.
googlePlus: "xxx-xxx-xxx", //Use for Google API clientID.
adMob: "xxx-xxx-xxx" //Use for AdMob API clientID.
}
};//end global variable
//mdThemingProvider use for change theme color of Ionic Material Design Appplication.
/* You can select color from Material Color List configuration :
* red
* pink
* purple
* purple
* deep-purple
* indigo
* blue
* light-blue
* cyan
* teal
* green
* light-green
* lime
* yellow
* amber
* orange
* deep-orange
* brown
* grey
* blue-grey
*/
//Learn more about material color patten: https://www.materialpalette.com/
//Learn more about material theme: https://material.angularjs.org/latest/#/Theming/01_introduction
$mdThemingProvider
.theme('default')
.primaryPalette('pink')
.accentPalette('red');
//mdIconProvider is function of Angular Material. It use for reference .SVG file and improve performance loading.
$mdIconProvider
.icon('facebook', 'img/icons/facebook.svg')
.icon('twitter', 'img/icons/twitter.svg')
.icon('mail', 'img/icons/mail.svg')
.icon('message', 'img/icons/message.svg')
.icon('share-arrow', 'img/icons/share-arrow.svg')
.icon('more', 'img/icons/more_vert.svg');
//$stateProvider is using for add or edit HTML view to navigation bar.
//
//Setting by :
//state_name(String) : Name of state to use in application.
//page_name(String) : Name of page to present at localhost url.
//cache(Bool) : Cache of view and controller default is true. Change to false if you want page reload when application navigate back to this view
//html_file_path(String) : Path of html file.
//controller_name(String) : Name of Controller.
//
//Learn more about ionNavView at http://ionicframework.com/docs/api/directive/ionNavView/
//Learn more about AngularUI Router's at https://github.com/angular-ui/ui-router/wiki
$stateProvider
.state('app', {
url: "/app",
abstract: true,
templateUrl: "templates/menu/html/menu.html",
controller: 'menuCtrl'
})
//use for change ionic spinner to android pattern.
$ionicConfigProvider.spinner.icon("android");
var appControllers = angular.module('starter.controllers', []); //Use for all controller of application.
var appServices = angular.module('starter.services', []); //use for all service of application.
//This is controller for Dialog box
appControllers.controller('DialogController', function ($scope, $mdDialog, displayOption) {
//this variable for display wording of dialog.
//object schema:
//displayOption: {
// title: "Confirm to remove all data?",
// content: "All data will remove from local storage.",
// ok: "Confirm",
// cancel: "Close"
//}
$scope.displayOption = displayOption;
$scope.cancel = function () {
$mdDialog.cancel(); //close dialog.
};
$scope.ok = function () {
$mdDialog.hide();//hide dialog.
};
});//end controller for Dialog box.
//This is controller for toast
appControllers.controller('toastController', function ($scope, displayOption) {
//this variable for display wording of toast.
//object schema:
// displayOption: {
// title: "Data Saved !"
//}
$scope.displayOption = displayOption;
});//end controller for toast.
//Directive numbersOnly :
//Use for change input to have ability accept only number.
//Example :
//
appControllers.directive('numbersOnly', function () {
return {
require: 'ngModel',
link: function (scope, element, attr, ngModelCtrl) {
function fromUser(text) {
if (text) {
var transformedInput = text.replace(/[^0-9]/g, '');
if (transformedInput !== text) {
ngModelCtrl.$setViewValue(transformedInput);
ngModelCtrl.$render();
}
return transformedInput;
}
return undefined;
}
ngModelCtrl.$parsers.push(fromUser);
}
};
});//end Directive numbersOnly.
//Filter epochToDate : //Use for convert epoch date format to default date format. //Example : //{{item.createdAt |epochToDate | date:"short"}}
appControllers.filter('epochToDate', function ($filter) { return function (input) { return new Date(Date(input)); }; });//end Filter epochToDate. //Filter numberSuffix : //Use for convert number to have suffix 1,000 to 1K //Example : //{{item.likes.summary.total_count | numberSuffix}} // appControllers.filter('numberSuffix', function () { return function (input) { var exp; var suffixes = ['k', 'M', 'G', 'T', 'P', 'E']; if (window.isNaN(input)) { return 0; } if (input < 1000) { return input; } exp = Math.floor(Math.log(input) / Math.log(1000)); return (input / Math.pow(1000, exp)).toFixed(1) + suffixes[exp - 1]; } });//end Filter numberSuffix.
// For using social share you have to install $cordovaSocialSharing by running the following
// command in your cmd.exe for windows or Terminal for mac:
// $ cd your project path
// $ ionic plugin remove nl.x-services.plugins.socialsharing
// $ ionic plugin add https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin.git
//
// For using save image you have to install Canvas2ImagePlugin by running the following
// command in your cmd.exe for windows or Terminal for mac:
// $ cd your project path
// $ ionic plugin remove org.devgeeks.Canvas2ImagePlugin
// $ ionic plugin add https://github.com/devgeeks/Canvas2ImagePlugin.git
//
// Controller of product list Page.
appControllers.controller('productListCtrl', function ($scope, $timeout, $state, $http) {
// This function is the first activity in the controller.
// It will initial all variable data and let the function works when page load.
$scope.initialForm = function () {
// $scope.productList is the variable that store user product data.
$scope.productList = [];
// loading progress
$timeout(function () {
if ($scope.isAndroid) {
jQuery('#product-list-loading-progress').show();
}
else {
jQuery('#product-list-loading-progress').fadeIn(700);
}
}, 400);
$timeout(function () {
jQuery('#product-list-loading-progress').hide();
jQuery('#product-list-content').fadeIn();
}, 4000);// End loading progress
};// End initialForm
// navigateTo is for navigate to other page.
// by using targetPage to be the destination page
// and send object to the destination page.
// Parameter :
// targetPage = destination page.
// objectData = object data that sent to destination page.
$scope.navigateTo = function (targetPage, objectData) {
$state.go(targetPage, {
product: objectData
});
};// End navigateTo
// loadMore is for loadMore product list.
$scope.loadMore = function () {
$timeout(function () {
//get product list from json at paht: www/app-data/product-list.json
$http.get('app-data/product-list.json')
.success(function (productList) {
// Success retrieve data.
// Store user data to $scope.productList.
for (var product = 0; product < productList.length; product++) {
$scope.productList.push(productList[product]);
}
// To stop loading progress.
$scope.$broadcast('scroll.infiniteScrollComplete');
});
}, 2000);
};// End loadMore
$scope.initialForm();
});// End of product list controller.
// Controller of product Detail Page.
appControllers.controller('productDetailCtrl', function ($scope, $mdToast, $mdBottomSheet, $timeout, $stateParams) {
// This function is the first activity in the controller.
// It will initial all variable data and let the function works when page load.
$scope.initialForm = function () {
//$scope.product is product detail
// $stateParams.product is the object that pass from product list page.
$scope.product = $stateParams.product;
// Loading progress.
$timeout(function () {
if ($scope.isAndroid) {
jQuery('#product-detail-loading-progress').show();
}
else {
jQuery('#product-detail-loading-progress').fadeIn(700);
}
}, 400);
$timeout(function () {
jQuery('#product-detail-loading-progress').hide();
jQuery('#product-detail-content').fadeIn();
}, 3000);// End loading progress
};// End initialForm
// addToCart for show Item Added ! toast.
$scope.addToCart = function () {
$mdToast.show({
controller: 'toastController',
templateUrl: 'toast.html',
hideDelay: 800,
position: 'top',
locals: {
displayOption: {
title: "Item Added !"
}
}
});
}; // End addToCart
// sharedProduct fro show shared social bottom sheet by calling sharedSocialBottomSheetCtrl controller
$scope.sharedProduct = function ($event, product) {
$mdBottomSheet.show({
templateUrl: 'bottom-sheet-shared.html',
controller: 'sharedSocialBottomSheetCtrl',
targetEvent: $event,
locals: {
product: product
}
});
};// End sharedProduct
$scope.initialForm();
});// End of product list controller.
// Controller of share social bottom sheet.
appControllers.controller('sharedSocialBottomSheetCtrl', function ($scope, $mdBottomSheet, $timeout, product, $mdToast, $cordovaSocialSharing) {
// This function is the first activity in the controller.
// It will initial all variable data and let the function works when page load.
$scope.initialForm = function () {
//$scope.setCanvasImage for set canvas image to save to your mobile gallery.
$scope.setCanvasImage(product.img);
//$scope.isSaving is image saving status.
$scope.isSaving = false;
};// End initialForm
//setCanvasImage for set canvas image to save to your mobile gallery.
$scope.setCanvasImage = function (imgPath) {
// create canvas image
var canvas = document.getElementById('imgCanvas');
var context = canvas.getContext('2d');
var imageObj = new Image();
imageObj.onload = function () {
canvas.height = this.height;
canvas.width = this.width;
context.drawImage(imageObj, 0, 0);
};
//image path.
imageObj.src = imgPath;
return canvas.toDataURL();
};// End setCanvasImage
// getCanvasImageUrl for get canvas image path.
$scope.getCanvasImageUrl = function () {
var canvas = document.getElementById('imgCanvas');
return canvas.toDataURL();
};// End getCanvasImageUrl
// sharedFacebook for share product picture to facebook by calling $cordovaSocialSharing
$scope.sharedFacebook = function () {
$cordovaSocialSharing.shareViaFacebook(" ", $scope.getCanvasImageUrl());
$mdBottomSheet.hide();
}// End sharedFacebook
// sharedTwitter for share product picture to twitter by calling $cordovaSocialSharing
$scope.sharedTwitter = function () {
$cordovaSocialSharing.shareViaTwitter(" ", $scope.getCanvasImageUrl());
$mdBottomSheet.hide();
}// End sharedTwitter
// sharedMail for share product picture to email by calling $cordovaSocialSharing
$scope.sharedMail = function () {
$cordovaSocialSharing.shareViaEmail(" ", "Shopping with ionic meterial", "ionicmaterialdesign@gmail.com", "cc@IonicMeterial.com", "bcc@IonicMeterial.com", $scope.getCanvasImageUrl());
$mdBottomSheet.hide();
}// End sharedMail
// saveImage for save product picture to mobile gallery.
$scope.saveImage = function () {
if ($scope.isSaving == false) {
try {
// calling canvas2ImagePlugin to save image to gallery.
window.canvas2ImagePlugin.saveImageDataToLibrary(
function (msg) {
},
function (err) {
throw err;
},
document.getElementById('imgCanvas'));
$scope.isSaving = true;
// show Image Saved ! toast when save image success.
$mdToast.show({
controller: 'toastController',
templateUrl: 'toast.html',
hideDelay: 800,
position: 'top',
locals: {
displayOption: {
title: "Image Saved !"
}
}
});
}
catch (e) {
console.log(e);
// show Save Failed : Please try again! toast when save image is error.
$mdToast.show({
controller: 'toastController',
templateUrl: 'toast.html',
hideDelay: 800,
position: 'top',
locals: {
displayOption: {
title: "Save Failed : Please try again!"
}
}
});
}
}
// hide bottom sheet
$timeout(function () {
$mdBottomSheet.hide();
}, 1800);
}// End saveImage
// sharedMore for hide bottom sheet
$scope.sharedMore = function () {
$mdBottomSheet.hide();
}// End sharedMore
$scope.initialForm();
});// End of share social bottom sheet controller.
// Controller of product check out page.
appControllers.controller('productCheckoutCtrl', function ($scope, $mdToast, $mdDialog) {
//You can do some thing hear when tap on a credit card button.
$scope.doSomeThing = function () {
}// End doSomeThing
// showConfirmDialog for show alert box.
$scope.showConfirmDialog = function ($event) {
//mdDialog.show use for show alert box for Confirm to complete order.
$mdDialog.show({
controller: 'DialogController',
templateUrl: 'confirm-dialog.html',
targetEvent: $event,
locals: {
displayOption: {
title: "Complete Order",
content: "Confirm to complete Order.",
ok: "Confirm",
cancel: "Close"
}
}
}).then(function () {
// For confirm button to complete order.
//Showing Order Completed. Thank You ! toast.
$mdToast.show({
controller: 'toastController',
templateUrl: 'toast.html',
hideDelay: 1200,
position: 'top',
locals: {
displayOption: {
title: "Order Completed. Thank You !"
}
}
});
}, function () {
// For cancel button to complete order.
});
}// End showConfirmDialog
});// End of product check out controller.
All Javascript framework is reference at www/index.html at <head> section :
<!--head section This is a place of all reference of css and javascript lib-->
<head>
<!-- Meta section -->
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<meta name="format-detection" content="telephone=no"> <!-- To disable phone number typing.-->
<!-- end Meta section -->
<title></title>
<!-- Font reference section -->
<link href="lib/robotodraft/robotodraft.css">
<!-- end Font reference section -->
<!-- CSS reference section -->
<link rel="stylesheet" href="css/ionic.app.css">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet prefetch" href="lib/angular-material/angular-material.css">
<link rel="stylesheet" href="lib/font-awesome-4.4.0/css/font-awesome.css">
<!-- end CSS reference section -->
<!-- Ionic javascript lib -->
<script src="lib/ionic/js/ionic.bundle.js"></script>
<!-- end Ionic javascript lib -->
<!-- Angular javascript lib -->
<script src="lib/angular-messages/angular-messages.js"></script>
<script src="lib/angular-aria/angular-aria.js"></script>
<script src="lib/angular-material/angular-material.js"></script>
<!-- end Angular javascript lib -->
<!-- Cordova script (this will be a 404 during development) -->
<script src="lib/ngCordova/dist/ng-cordova.js"></script>
<script src="cordova.js"></script>
<!-- end Cordova script -->
<!--ionic framework ngIOS9UIWebViewPatch-->
<!--Learn more about ngIOS9UIWebViewPatch at : http://blog.ionic.io/ios-9-potential-breaking-change/-->
<script src="lib/ngIOS9UIWebViewPatch/angular-ios9-uiwebview.patch.js"></script>
<!--end ionic framework ngIOS9UIWebViewPatch-->
<!-- app.js section-->
<script src="js/app.js"></script>
<!-- end app.js section-->
<!-- Controllers section-->
<script src="js/controllers.js"></script>
<script src="js/shared/directives.js"></script>
<script src="js/shared/filter.js"></script>
<script src="js/shared/controllers.js"></script>
<script src="templates/menu/js/controllers.js"></script>
<script src="templates/material-user-interface/dashboard/js/controllers.js"></script>
<script src="templates/application-storage/sqLite/js/controllers.js"></script>
<script src="templates/application-storage/sqLite/js/services.js"></script>
<script src="templates/application-storage/local-application-db/js/controllers.js"></script>
<script src="templates/application-storage/local-application-db/js/services.js"></script>
<script src="templates/social-network-connect/facebook/js/controllers.js"></script>
<script src="templates/social-network-connect/instagram/js/controllers.js"></script>
<script src="templates/social-network-connect/google-plus/js/controllers.js"></script>
<script src="templates/social-network-connect/foursquare/js/controllers.js"></script>
<script src="templates/social-network-connect/dropbox/js/controllers.js"></script>
<script src="templates/share-application-content/social-share/js/controllers.js"></script>
<script src="templates/share-application-content/email-message/js/controllers.js"></script>
<script src="templates/hardware-connect/device-information/js/controllers.js"></script>
<script src="templates/hardware-connect/mobile-contract/js/controllers.js"></script>
<script src="templates/hardware-connect/flash-light/js/controllers.js"></script>
<script src="templates/hardware-connect/vibration/js/controllers.js"></script>
<script src="templates/advertising-application/googleAdmob/js/controllers.js"></script>
<script src="templates/hardware-connect/image-picker/js/controllers.js"></script>
<script src="templates/social-network-connect/wordpress/js/controllers.js"></script>
<script src="templates/material-user-interface/dashboard/js/controllers.js"></script>
<script src="templates/material-user-interface/default-user-interface/js/controllers.js"></script>
<script src="templates/themes/menu-dashboard/js/controllers.js"></script>
<script src="templates/themes/expense-dashboard/js/controllers.js"></script>
<script src="templates/themes/catalog/js/controllers.js"></script>
<script src="templates/push-notification/single-push-notification/js/controllers.js"></script>
<script src="templates/push-notification/schedule-push-notification/js/controllers.js"></script>
<!-- end Controllers section-->
<!-- jQuery section-->
<script src="lib/jQuery/jquery.js"></script>
<!-- end jQuery section-->
</head><!-- end head section-->
If you would like to change theme color of this application please following below step :
$mdThemingProvider
.theme('default')
.primaryPalette('pink')
.accentPalette('red');
To disable push up the screen when android keyboard was show up.
To disable phone number typing.
Go to yourProjectPath/www/index.html and put this following code in the
meta area on head section.
<meta name="format-detection" content="telephone=no">
To allow application to using mobile phone call.
Go to yourProjectPath/config.xml and put this following code
in the access area.
<access origin="tel:*" launch-external="yes"/>
This is the main feature of Ionic Material Design Application that include of many components. In this section will introduce you all component detail. You will know what is it, how it work and how to use it.
Source Code Structure
We have added a comment of description
how to get the component work in source code.
Java Script :SQLite Database
Application Storage
{{ contract.firstName }} {{ contract.lastName }}
// Controller will call ContractDB Services to present data to html view.
//
// For using sqlite you have to install $cordovaSQLite by running the following
// command in your cmd.exe for windows or Terminal for mac:
// cd your project path
// $ ionic plugin remove io.litehelpers.cordova.sqlite
// $ ionic plugin add https://github.com/litehelpers/Cordova-sqlite-storage.git
//
// Learn more about $cordovaSQLite :
// http://ngcordova.com/docs/plugins/sqlite/
//
// Controller of Contract List Page.
appControllers.controller('contractListCtrl', function ($scope, $filter, $mdDialog, $timeout, $ionicModal, $state, $mdBottomSheet, ContractDB) {
// initialForm is the first activity in the controller.
// It will initial all variable data and let the function works when page load.
$scope.initialForm = function () {
// $scope.contracts is the variable that store data from ContractDB service.
$scope.contracts = [];
// $scope.filterText is the variable that use for searching.
$scope.filterText = "";
// The function for show/hide loading progress.
$timeout(function () {
if ($scope.isAndroid) {
jQuery('#contract-list-loading-progress').show();
}
else {
jQuery('#contract-list-loading-progress').fadeIn(700);
}
}, 400);
$timeout(function () {
////Get all contracts.
$scope.getContractList();
jQuery('#contract-list-loading-progress').hide();
jQuery('#contract-list-content').fadeIn();
}, 3000);// End loading progress.
};// End initialForm.
// getContractList is for get all contracts.
// By calling ContractDB.all() service.
$scope.getContractList = function () {
$scope.contracts = ContractDB.all();
};//End getContractList.
// updateContract is for update contracts.
// By sending contract to ContractDB.update(contract) service.
// Parameter :
// contract = contract that user select from view.
$scope.updateContract = function (contract) {
ContractDB.update(contract);
};// End updateContract.
// navigateTo is for navigate to other page
// by using targetPage to be the destination page
// and sending objectData to the destination page.
// Parameter :
// targetPage = destination page.
// objectData = object that will sent to destination page.
$scope.navigateTo = function (targetPage, objectData) {
$state.go(targetPage, {
contractdetail: objectData,
actionDelete: (objectData == null ? false : true)
});
};// End navigateTo.
$scope.initialForm();
});// End of Contract List Page Controller.
Every application have to store data. We will introduce you to using application storage to store data in your application by using SQLite and LocalStorage.
SQLite is the best way to store data to application storage. It allow you to manage complex relational database.
Advantage of SQLite it have unlimit ability to store data. It will create the sqlite file that store in the application. Also can store more complex data such as relation between tables.
We use SQLite function to create a small contract application that including function to :
LocalStorage have ability to store data by HTML5 loacalStorage function.
We use LocalStorage function to create a notes application that including function to :
Using Social Network Connect for connect your application with social network. You can use it to be your application log in authentication and get user profile information from social network. Also it can retrieve data object of user timeline.
Advantage of Social Network Connect is you don't need to create login page for your application just use social log in authentication. And it is easy for user to login.
Getting WordPress feed by input your WordPress URL to application. It will use WP REST API for connecting with WordPress Feed.
The function include:
Use cordovaOauth for connect with facebook to get user profile information, user timeline and friend list by calling facebook API.
The function include:
Use cordovaOauth for connect with Google to get user profile information and user activity by calling Google API.
The function include:
Use cordovaOauth for connect with instagram to get user profile information and user feed by calling instagram API.
The function include:
Use cordovaOauth for connect with foursquare to get user profile information and user tips feed by calling foursquare API.
The function include:
Use cordovaOauth for connect with dropbox to get user profile information and user files directory feed by calling dropbox API.
The function include:
Share Application Content is for share content from the application to social network by using feature of ngCordova.
Using cordovaSocialSharing for share application content to social network and using Canvas2ImagePlugin for save image to mobile gallery.
The function include:
Using cordovaSocialSharing for send email from the application and using cordovaSMS for sent message.
The function include:
Using Google AdMob for earning money to your application. By using AdMob Pro.
The function include:
Push Notification is for sent local notification from application to interactive with user.
To send notification for interact with user by sending single message.
The function include:
To send notification for interact with user by sending message with schedule queue.
The function include:
Map API Connect is for connect the application with map application.
To connect the application with map application.
The function include:
To connect the application with map application.
The function include:
Hardware Connect is for connecting with mobile feature by using ngCordova.
Using cordovaContacts for connecting the application to mobile contract.
The function include:
Using cordovaImagePicker for selecting image from mobile gallery.
The function include:
Using cordovaVibration for using mobile vibration.
The function include:
Using cordovaFlashlight for using mobile flashlight.
The function include:
Using ionic.Platform.device for get device information.
The function include:
Material theme that will help you to generate idea to create your powerful application.
Problem : Ionic Material Design doesn't support HTML button Tag, Because Angular material and angular-aria will have double event when tap at the HTML button Tag on Mobile Browser.
Solution : Ionic Material Design avoid this issue by using HTML a to create button by :
<a class="md-raised md-button" href="#" ng-click="doSomeThing()">Button</a>To create button :
.
Foursquare and Dropbox feed API have no paging so it cannot do load more function.
For get all contracts you have to wait more than 2 sec for loading contracts form device (depend on data size).
Application will lag and slow if image size are large.
This project was tested in :
If you found any bug, please use the theme comment section or report it to us describing:
Important : We not support the error case of this project from :
Please use this following link to help you find useful information :
I've used the following Icons, Framework, Idea , Inspiration or Other files as listed. - Also a thanks to all the awesome resources I've used for the development of this project.
Resources used in Development
Resources used in Design
Once again, thank you so much for purchasing Ionic Material Design. As I said at the beginning, I'd be glad to help you if you have any questions relating to this project. No guarantees, but I'll do my best to assist. If you have a more general question relating to the project on Codecanyon, you might consider visiting the forums and asking your question in the "Item Discussion" section.
Ionic Material Design Team