Search Posts

Category: jquery

autocomplete location angularjs not work on popup

In my application, I use google location autocomplete to suggest location when I enter some text. without popup then location autocomplete work fine but when I use location autocomplete on a popup then it not working. I use a directive (function() { ‘use strict’; angular .module(‘crmApp’) .directive(‘googleplace’, directiveFunction); directiveFunction.$inject = [‘$rootScope’]; function directiveFunction($rootScope) { return { require: ‘?ngModel’, scope: { ngModel: ‘=’, details: ‘=?’ }, link: function(scope, element, attrs, model) { var options = { […]

AngularJS – Bind to Scroll (Mousewheel, Dragging Bar, and Touch Swiping)

I made a very shabby “Infinite-Scroll” directive, all other solutions were incompatible with a md-grid-list so I went ahead and made my own alternative workaround. app.directive(‘scrollTrigger’, function($window) { return { link : function(scope, element, attrs) { var e = angular.element(element[0]); e.bind(‘mousewheel’, function() { var parent = e.offsetParent()[0]; if (parent.scrollTop + parent.offsetHeight > (70/100*parent.scrollHeight)) { scope.$apply(attrs.scrollTrigger); } }); } }; }); You simply put scroll-trigger on the html element that will be scrollable. The code checks […]

using jquery plugin with dynamic data comes from services in angular4

i recent using angular4 and i want to make ticker the ticker’s data come from ticker service in angular4 the ticker service code is import { Injectable } from ‘@angular/core’; @Injectable() export class TickerService { constructor() { } getTickerList() { return[{img:”../../assets/images/profile-pics.jpg”,title:”Added New Post-1″,des:”كما يشترط فيها أن تحقق هدفاً أو أكثر من الأهداف الخاصة بالجائزة وفق تقدير اللجنة. كان من المقرر منح أول جائزة منها سنة 1399هـ / 1979م إلا أنها حُجبت لعدم توفر متطلبات الفوز […]

Multiplication on click show into input filed with Different ID

I am designing shopping cart functionality. And Fresher in jQuery My layout is This is my design I want to when click on increment and Decrements button then increment value and decrements value multiply into input field value below is my jQuery code $(‘.increment-btn’).on(‘click’,function(){ var $counter=$(this).closest(‘td’).find(‘.counter’); var currentVal = parseInt($counter.val()); if (!isNaN(currentVal) && currentVal > 0) {$counter.val(currentVal – 1); } }); this is HTML code <table Style=”width:100%;” class=”sumtable”> <tr> <td id=”info” Style=”padding-left: 3%;width: 20%; “>Buy […]

Toggling right-arrow to down arrow in jquery [accordion-like]

I have designed a sort of accordion. When I click on the right-arrow of an item, say Area A, it toggles to give me the list of item in Area A and at the same time, the arrow-right goes down (Like this: ▼). When I click it again, the list hides and the arrow becomes in arrow-right again. Note that in Area A, I will have a sub list. Can someone help me to achieve […]

angularjs and jquery conflict cause chrome stop responsing

<div class=”gridly-static”> <div id={{y.id}} ng-repeat=”y in Categories” ng-init=”initCategories()”> <div class=”title”>{{y.name}}</div> </div> </div> Categories variable is fetched from api service via $http.get(),and ng-init call initCategories is to reset the layout dynamically using jquery-gridly.The combination of two things make my chrome stop responding(The tab also can’t close at all) When I change the Categories to a object(don’t fetch from internet), the code works find. Also, When I don’t init the layout using $(‘xxx’).gridly(), it works too. I […]

AngularJS – Is it possible to store {{expressions}} as a $scope.variable value?

I am building a Rails app but using AngularJS for bits of the front end. Is it possible to store {{expressions}} as a $scope.variable value? Code: Here is the angular controller // I am pulling data from the rails controller via the gon gem. $scope.entertainmentTemplate = gon.active_entertainment_template.description; Which translates to: $scope.description = “{{productName}} is a great product and also has awesome {{additionalInfo}}. These are some more example words, blah blah..”; Defined variables in angular controller: […]

How to use loader while page rendering in angular 2?

I have a loader.gif image with a flag variable to show and hide. <div [hidden]=”IsLoading” class=”loadingDiv”></div> In my html having 200 records without pagination(the requirement is not need pagination). So I felt the rendering time is taking some time(around 5-10 sec). so I have planed to use loader. cutomLoad() { this.IsLoading = false; this.tyreAndRimList = this.temptyreAndRimList; // here having 200 records. this.IsLoading = true; } I have tried above code. The code run very quick […]

Uncaught TypeError: Cannot read property ‘attributes’ of undefined

Hello everyone i am trying to perform delete operation in my web app,when i am deleting an element from DB, in console its showing this error.Please give your valuable solution for this Thanks in advance. Uncaught TypeError: Cannot read property ‘attributes’ of undefined at _clearTreeSelection (orphanController.js:888) at Scope.$scope.clearSelection (orphanController.js:659) at HTMLDivElement.<anonymous> (orphanController.js:1058) at line number 888 this is my code: //This is to clear the selectedNode of angular tree on modal close _clearTreeSelection = function […]

Next Page »