Skip to content
InfinityKnow

InfinityKnow

Infinity Knowledge (IK) : Technology, Articles, Topics, Facts or many More.

  • Home
  • Education
    • yttags
    • Make Money
    • Jobs
    • Programming
      • Technology
      • Web Design
      • WEB HOSTING
      • Interview
  • Entertainment
    • pakainfo
    • Sports
    • Tips and Tricks
      • Law
      • Photography
      • Travel
  • Health
    • Insurance
    • Lifestyle
      • Clothing
      • Fashion
      • Food
  • News
    • Insurance
      • Auto Car Insurance
      • Business Insurance
    • Donate
    • California
  • News
    • Political
  • Home Improvement
  • Trading
    • Marketing
    • Top Tranding
    • Business
    • Real Estate
  • Full Form
  • Contact Us
  • Love shayari in english Shayari
  • vuejs Autocomplete textbox PHP MySQLi Technology
  • Tourist
    Top Tourist Attractions In Bali – Explore This Island Paradise Like A Local Travel
  • dop full form – dop full form Kya Hai, Meaning and Abbreviation – What is the full form of dop full form? full form
  • Home insurance quotes Quotes
  • prd full form – prd Kya Hai, Meaning and Abbreviation – What is the full form of prd? full form
  • AngularJS access parent scope from child controller Example
    AngularJS access parent scope from child controller Example Technology
  • Angular UI Bootstrap modals load template Solution
    Angular UI Bootstrap modals load template Solution Technology
ngTouch event example using angularjs-ngtouch directive

ngTouch event example using angularjs-ngtouch directive

Posted on July 9, 2018July 9, 2018 By admin No Comments on ngTouch event example using angularjs-ngtouch directive

ngTouch event example using angularjs-ngtouch directive

Installation

A angularjs simple add bew module to add directives for touch mobile,iphone,tablet or more devices.

[php]
“//ajax.googleapis.com/ajax/libs/angularjs/X.Y.Z/angular-touch.js”


[/php]

A angularjs module to simple add directives for some touch devices.

How to use it

You must here app’s include the ngTouch directive dependency on your module add angular module:

[php]
var app = angular.module(“infinityApp”, [“ngTouch”]);

[/php]

Example

index.html

[php]

ngtouch directive angularjs example jsfiddle

Touch device or click device me
Touch device or click device me
Touch device or click device me


Display : {{comment.join(‘ | ‘)}}

[/php]

index.js

[php]
var app = angular.module(‘test’, []);

app.directive(‘onTouch’, function() {
return {
restrict: ‘A’,
link: function(scope, elm, attrs) {
var ontouchFn = scope.$eval(attrs.onTouch);
elm.bind(‘touchstart’, function(evt) {
scope.$apply(function() {
ontouchFn.call(scope, evt.which);
});
});
elm.bind(‘click’, function(evt){
scope.$apply(function() {
ontouchFn.call(scope, evt.which);
});
});
}
};
});

READ :  Angular ng bind directive Example

app.controller(‘liveCtrl’, function($scope) {
$scope.comment = [];
$scope.livetouch = function(item) {
(item) ? item = 1 : null
for (var i =0 ; i< item ; i++) { $scope.comment.push("Fire"); } }; }); [/php]

style.css

[php]
.btn {
display: block;
border: 2px solid;
height: 150px;
width: 150px;
float: right;
margin: 15px;
padding: 10px;
}
[/php]

Example

Related posts:

  1. AngularJs ng click and ng touch mobile device
  2. Vuejs Simple Navigation Menu vue router-link params
  3. Angularjs Dropdown onchange Example – AngularJS ng-change Event with Checkbox Select Text Example
  4. AngularJS Custom scrollbar Directive Example – ngscrollbar Example
Technology, AngularJs Tags:angularjs ngtouch example, ng-mobile-click, ng-swipe-left, ng-swipe-up, ng-touched in angularjs, ng-touchstart, ngtouch angular 2, ngtouch.info is not a function

Post navigation

Previous Post: vue autocomplete text input example – vuejs-autocomplete textbox
Next Post: Fastest Way To Find Long Tail High Paying AdSense CPC Keywords

Related Posts

  • Angular ngShow and ngHide Directive Technology
  • Angular Interval Service Example Technology
  • PHP Print number Pattern Program
    PHP Print number Pattern Program with Example Technology
  • Redirect page after delay using AngularJS
    Redirect page after delay using AngularJS Technology
  • Get Url Parameter with Query String using angularjs
    Get Url Parameter with Query String using angularjs Technology
  • Vue Drag and Drop Sortable Example – Vuejs Draggable
    Vue Drag and Drop Sortable Example – Vuejs Draggable Technology

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • Account web hosting (1)
  • AngularJs (277)
  • Articles (143)
  • Asp.Net (49)
  • Astrology (2)
  • Attorney (7)
  • Auto Car Insurance (4)
  • Biography (2)
  • Business (9)
  • Business Insurance (3)
  • California (4)
  • Choose the web hosting (1)
  • Clothing (6)
  • cloud (8)
  • Cloud data storage (2)
  • Credit (1)
  • Dedicated hosting server web (1)
  • Dedicated server web hosting (1)
  • Dedicated web hosting (1)
  • Degree (11)
  • Design (9)
  • Differences shared hosting (1)
  • Donate (2)
  • Education (37)
  • Energy web hosting (1)
  • Entertainment (6)
  • Facts (12)
  • Fashion (3)
  • Finance (3)
  • Food (5)
  • full form (90)
  • Google Adsense (22)
  • Health (20)
  • Home Improvement (5)
  • Insurance (6)
  • Interview (2)
  • Jobs (6)
  • jquery (2)
  • jQuery (2)
  • Laravel (164)
  • Lawyer (4)
  • Lifestyle (6)
  • Loans (6)
  • Make Money (31)
  • Managed dedicated server (1)
  • Managed hosting solution (1)
  • Managed servers (1)
  • Marketing (8)
  • Mortgage (2)
  • Movies (21)
  • MySQL (180)
  • News (5)
  • Photography (1)
  • PHP (250)
  • Programming (18)
  • Quotes (75)
  • Real Estate (2)
  • SEO (9)
  • Shared web hosting (1)
  • Shayari (67)
  • Sports (5)
  • Status (34)
  • Stories (45)
  • suvichar (8)
  • Tech (3)
  • Technology (675)
  • Tips and Tricks (42)
  • Top Tranding (35)
  • Trading (28)
  • Travel (12)
  • Uncategorized (8)
  • VueJs (179)
  • Web Design (2)
  • WEB HOSTING (1)
  • Web hosting company (1)
  • Web hosting really (1)
  • Web hosting windows (1)
  • Which website hosting (1)
  • Wishes (13)
  • wordpress (15)

Categories

AngularJs (277) Articles (143) Asp.Net (49) Attorney (7) Business (9) Clothing (6) cloud (8) Degree (11) Design (9) Education (37) Entertainment (6) Facts (12) Food (5) full form (90) Google Adsense (22) Health (20) Home Improvement (5) Insurance (6) Jobs (6) Laravel (164) Lifestyle (6) Loans (6) Make Money (31) Marketing (8) Movies (21) MySQL (180) News (5) PHP (250) Programming (18) Quotes (75) SEO (9) Shayari (67) Sports (5) Status (34) Stories (45) suvichar (8) Technology (675) Tips and Tricks (42) Top Tranding (35) Trading (28) Travel (12) Uncategorized (8) VueJs (179) Wishes (13) wordpress (15)
  • Vuejs Implementing Routes And Multiple Views Example
    Vuejs Implementing Routes And Multiple Views Example Technology
  • AngularJS RESTful Web Service GET and POST API
    AngularJS RESTful Web Service GET and POST API Technology
  • Inspirational quotes Quotes
  • Forehead Lift
    Know More About The Forehead Lift Health
  • How To Start A Paper Bag Business? Articles
  • sez full form – sez Kya Hai, Meaning and Abbreviation – What is the full form of sez? full form
  • Dynamically Added Meta Data,keywords,title using AngularJS
    Dynamically Added Meta Data,keywords,title using AngularJS Technology
  • Online Hire PHP Developers in Australia
    Online Hire PHP Developers in Australia Technology

Copyright © 2022 InfinityKnow.

Powered by PressBook News WordPress theme