Skip to content

Instantly share code, notes, and snippets.

View pankajpatel's full-sized avatar
🎯
Focusing

Pankaj Patel pankajpatel

🎯
Focusing
View GitHub Profile
@pankajpatel
pankajpatel / ToDoAppTaskList.html
Last active November 28, 2017 09:50
ToDo App Task List
<ul class="list-group">
<li class="list-group-item clearfix task">
<p class="lead">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua.</p>
<div>
<span class="pull-right">
<button class="btn btn-default btn-xs"><span class="glyphicon glyphicon-pencil"></span></button>
<button class="btn btn-primary btn-xs"><span class="glyphicon glyphicon-ok"></span></button>
<button class="btn btn-primary btn-xs"><span class="glyphicon glyphicon-repeat"></span></button>
<button class="btn btn-danger btn-xs"><span class="glyphicon glyphicon-remove"></span></button>
@pankajpatel
pankajpatel / ToDoAppTaskAdditionForm.html
Last active November 28, 2017 09:49
ToDo App Task Addition Form
<div class="form">
<div class="input-group">
<input type="text" class="form-control">
<span class="input-group-btn">
<button class="btn btn-default" type="button">
<span class="glyphicon glyphicon-plus"></span> Add Task</button>
</span>
</div>
</div>
<hr/>
@pankajpatel
pankajpatel / ToDoAppHtmlPart.html
Last active November 28, 2017 09:46
ToDo App Whole HTML with AngularJS Binding
<body ng-app="toDoApp">
<div class="container" ng-controller="ToDoController">
<div class="col-xs-12 col-sm-12 col-md-offset-3 col-md-5 col-lg-offset-3 col-lg-5">
<h2>ToDo App</h2>
<!-- Form Starts Here -->
<div class="form">
<div class="input-group">
<input type="text" class="form-control" ng-model="task">
<span class="input-group-btn">
<button class="btn btn-default" type="button" ng-click="addTask()"><span
@pankajpatel
pankajpatel / ToDoAppTaskAngularJsList.html
Last active November 28, 2017 09:45
ToDo App Task AngularJS List
<!-- Task List Starts Here -->
<ul class="list-group" ng-show="tasks.length > 0">
<li class="list-group-item clearfix task" ng-repeat="todo in tasks" ng-class="{disabled: todo.done}">
<p class="lead">{{todo.task}}</p>
<div>
<span class="pull-right">
<button class="btn btn-default btn-xs"><span class="glyphicon glyphicon-pencil"
ng-click="editTask($index)"></span></button>
<button class="btn btn-primary btn-xs" ng-show="!todo.done"><span class="glyphicon glyphicon-ok"
ng-click="doneTask($index)"></span></button>
@pankajpatel
pankajpatel / ToDoAppFormHandlingAngularJsCode.js
Last active November 28, 2017 09:45
ToDo App Form Handling AngularJS Code
$scope.tasks = [];
$scope.editIndex = false;
$scope.addTask = function () {
if( $scope.editIndex === false){
$scope.tasks.push({task: $scope.task, done: false})
} else {
$scope.tasks[$scope.editIndex].task = $scope.task;
}
$scope.editIndex = false;
$scope.task = '';
@pankajpatel
pankajpatel / ToDoAppTaskActionsAngularJsCode.js
Last active November 28, 2017 09:45
ToDo App Task Actions AngularJS Code
$scope.editTask = function (index) {
$scope.task = $scope.tasks[index].task;
$scope.editIndex = index;
}
$scope.doneTask = function (index) {
$scope.tasks[index].done = true;
}
$scope.unDoneTask = function (index) {
$scope.tasks[index].done = false;
}
@pankajpatel
pankajpatel / ToDoAppAngularJsCode.js
Last active December 7, 2016 10:23
ToDoAppAngularJsCode
var app = angular.module('toDoApp', []);
app
.controller('ToDoController', ['$scope', function ($scope) {
$scope.tasks = [];
$scope.editIndex = false;
$scope.addTask = function () {
if( $scope.editIndex === false){
$scope.tasks.push({task: $scope.task, done: false})
} else {
$scope.tasks[$scope.editIndex].task = $scope.task;
@pankajpatel
pankajpatel / AngularStorageModule.js
Last active October 26, 2015 22:15
Storage Module written in AngularJS
angular
.module('storageModule', [])
.factory('store',['$window', function($window){
return {
setLocal: function( key, value ){
try{
if( $window.Storage ){
$window.localStorage.setItem(key, value);
return true;
} else {
@pankajpatel
pankajpatel / SampleAngularModule.js
Last active August 29, 2015 14:11
Sample Angular Module File
angular
.module('storageModule', [])
.factory('store',['$window', function($window){
return {
setLocal: function( key, value ){
//code to store the key & value pair in localStorage
},
getLocal: function( key ){
//code to get the key stored in localStorage
},
if( window.Storage ){
/*
* Get the values previously stored
*/
//get the `user` key stored in the session storage
//this will show the value if stored otherwise 'undefined'
console.log( sessionStorage.getItem('user') );
//get the `user` key stored in the local storage
//this will give 'undefined'
console.log( localStorage.getItem('user') );