AngularJS / Isotope-- calling .isotope("reLayout") after page loads

I'm trying to use isotope with AngularJS (to layout a set of "cards"). Instead of adding to the DOM directly, I add elements via isotope using container.isotope('insert',element). I do all this in the linking function, but it appears that when I insert stuff into the DOM in the linking function, the sizes aren't set correctly (in my case, height is 0), so the elements don't get drawn properly. If I resize the window, the elements then get draw correctly. I was thinking that I could use a w

Meteor (v0.5.7) with Meteor_angularjs (v1.2.0) generates 'html##html_attributes##' tag within body tag

I would like to know how to solve this issue which Meteor (v0.5.7) with Meteor_angularjs(v1.2.0) generates 'html##html_attributes##' tag within body tag. If I use Meteor(v0.5.6) with Meteor_angularjs(v1.2.0), this issue doesn't happen. So I think some generating code in Meteor(v0.5.7) has affected Meteor_angularjs. This case is like this: <html> <head>…</head> <body> <html##html_attributes##> <script type="text/javascript" src="/packages/underscore/und

AngularJS $timeout within a resource factory

I currently have an angular application which upon user login calls a service to begin a server call to refresh a count, only allowing for a server side return if the user is authenticated. resource.approvalsCount = 0; var approvalsCountTimer; resource.getApprovalsCount = function (username) { return resource.query({ username: username, q: 'approvalsCount' }).$then(function (response) { resource.approvalsCount = response.data.count; approvalsCountTimer =

Angularjs javascript swiper library in an angular directive

How would I initialize swiper library inside an angular js directive. Especially when the directive has the slides created with a ng-repeat Here is my first attempt on a plukr. http://plnkr.co/edit/LFV3Y1lxOl8GFmL2M3mP And here is the library http://www.idangero.us/sliders/swiper/

Dependecy trouble when testing AngularJS with Karma

I'm having trouble with dependencies in Karma test scenario. When preparing environment looks like this: beforeEach(module('printecAdminApp')); beforeEach(inject(function(restService) { testRestService = restService; injector = angular.injector(['ng']); })); and test scenario like this: it('simple REST GET', function() { injector.invoke(function($http) { var getResult, restOpt = testRestService.prepareRestCa

AngularJS selecting option value within multiple selects onload

I am experienced with JavaScript and jQuery, but new to AngularJS. I have a list of items and each item has a select with multiple options. I have AngularJS populating the list and populating each select with all options. I can select the options and it adds them (categories) to my list like this. $scope.items = [ {"text":"Butter","out":false,"staple":true,"category":{"name":"Frozen Foods","order":"1"}}, {"text":"Lemons","out":false,"staple":true,"category":{"name":"Produce","order":"2"

Angularjs How can i count element who are equal a value ng-repeat

How can i count element in a ng-repeat who are equal a variable for example i do have this ng-repeat and i want to count every elements who Fund.status are equals "Finish"or "Todo": <tbody ng-repeat="Fund in ListTask| filter:TreeFilter |orderBy:orderByField:reverseSort"> <tr ng-dblclick="open(Fund.id,Fund)" data-toggle="modal" data-target="{{Fund.type}}"> <td>{{Fund.id}}</td> <td>{{Fu

AngularJS / Web API 2 token Authenticaion

I am trying to accomplish two things here: 1) pass in a username and password from a login screen to getToken.getToken() which in turn calls getTokenFromServer.getToken which sets token to the returned token value. 2) call getToken.getToken each subsequent time from Angular controllers, but this time just returning the already retrieved token that I'm assuming is stored in the getToken factory since it's a singleton? Am I on the right track here with AngularJS / Web API 2 authentication?

AngularJS calculate a dynamic number of variables in braces

I want to calculate the total sum, of a dynamic number of variables within angular's brace syntax. The for loop I would normally use would look like : var total = 0; for(x=0; x< objects.length; x++) { total += objects[x].num; } I would like to recreate this as {{ total }} or {{total()}} and have the total update when ever one of the variables is changed.

How to use regular expression in angularjs

I have tried this code.. <script> angular.module('emailExample', []) .controller('ExampleController', ['$scope', function($scope) { $scope.text = 'me@example.com'; }]); </script> <form name="myForm" ng-controller="ExampleController"> Email: <input type="email" name="input" ng-model="text" required> <span class="error" ng-show="myForm.input.$error.required"> Required!</span> <span class="error" ng-show="myForm.input.$erro

AngularJS Unit Testing: WARN [proxy]: failed to proxy /.../logo.png (connect ECONNREFUSED)

Can someone help me figure this out? I've spent a lot of time on it already and I'm spinning my wheels with no resolution. I'm using Karma/Jasmine with AngularJS to run some unit tests (which use ngMock and not ngMockE2E). When I run unit tests, the images are not loading, and this is causing a bunch of WARN messages to appear in the console (which although not critical, it is undesirable as it may confuse future developers on the project). I'm using PhantomJS to run my unit tests. In my karm

Angularjs dropdown text need to be showing as a title of the dropdown

I have a requirement where I need to show the text of angularjs dropdown (Not value) in the title tag of the dropdown box. My angular code is like this : <select id="inputID" name="inputName" ng-options="item.value as item.display for item in genders" ng-model="model.Base.currentRecord.value.Code.value" class="form-control input-sm"> <option value="">Select...</option> </select> As the dropdown is being generated dynamical, the value of the options and the t

AngularJS form gets pristine but still submitted

According to the source of AngularJS (1.3.15), the FormController's method $setPristine() resets the forms $submitted status to false: form.$setPristine = function() { $animate.setClass(element, PRISTINE_CLASS, DIRTY_CLASS + ' ' + SUBMITTED_CLASS); form.$dirty = false; form.$pristine = true; form.$submitted = false; forEach(controls, function(control) { control.$setPristine(); }); }; The problem is that after submitting and calling this method inside a contro

Angularjs TimePicker directive won't submit time (undefined)

I was able to get my timepicker to display a time range dynamically as seen in this post: Dynamic Options for AngularJS Directive However, when using this approach, it won't submit the time on my form. It states it is undefined when having this usage: <input ng-if="timeOptions" type="text" placeholder="Start Time" id="timestart" pick-a-time="timeOptions" data-ng-model="itemtimestart" class="form-control" autocomplete="off"> It worked before I attempted to dynamically set the timerange,

Angularjs Angular variable in primefaces commandLink

I have a little issue with passing an angular variable as an argument in the action attribute of a commandlink. I tried: action="#{saisieConge.setCongeWithId({{row.congeId}})}" and action="#{saisieConge.setCongeWithId(row.congeId)}" Either way, it is not working :( We just start to integrate angular in our web application and change everything from jsf to angular would be to much of work at ounce. That is way I need to find a way to combine the two. I would like to avoid passing the angular v

Angularjs Getting angular route to trigger event to trigger on navigation to current url

Using angulars $route (https://docs.angularjs.org/api/ngRoute/service/$route) An event is emited when a route starts, ends and so forth. My use case is that whenever a user clicks a a href I want to call some method. However when the user is located at say /user/settings" and clicks on a href linking to the same path /user/settings no event is emitted. I don't want to add ng-click on every a href in my application but I need to have my method triggering, always when a user clicks a href. An

Angularjs md-gridlist in angular material design

I am new to material design. I was implementing a grid list using angular material design. I am trying to understand the concept of grid list. Can someone explain me the concept of angular material grid list?

Angularjs Angular ui-grid scope.$apply not working in custom directive

I am using ui-grid in my application. I use cellTemplate in columnDefs to delete the row and for that i use following directive. CellTemplate: <a href ng-confirm-click confirmed-click="deleteProductFn(row.entity._id)"> <i class="fa fa-trash text-danger"></i> </a> Directive .directive('ngConfirmClick', function () { return { link: function (scope, element, attr) { var msg = attr.ngConfirmClick || "Are you sure w

AngularJs Page Refresh Issue

Getting 404 error when I do refresh on angular page. HTTP Status 404 - /product/P12345 Below is the my route configuration MyApp.config(function($routeProvider, $locationProvider) { $routeProvider .when('/product', { templateUrl: 'components/product/product.html', controller: 'ProductCtrl' }); First time i'm hitting url as http://localhost:8080/index.html#/product/P12345 In the browser url get converted into http://localhost:8080/product/P12345 when i click o

Angularjs Define popover template inside directive template

Im trying to create a directive with popover functionality. My template isnt the shortest one, so I decided to use templateUrl for that. and then, I decided to use a template for my popover, so I tried using ng-template definition inside my directive template file, and using it with popover-template, but I cant see the tooltip. Here's the example: <script type="text/ng-template" id="myTemplate.html"> {{label}} </script> <div ng-if='label.length >= 5' popover-template='my

AngularJS : promise

I'm trying to use promises in my app , however I'm not sure if i do it right. The reason I use promise is because ,my app gets input of username and it needs to find it in the local storage, if it doesn't exist it makes a consloe.log(err). the code: modalInstance.result.then(function(conUser) { var promise = new Promise(function(resolve, reject) { // do a thing, possibly async, then… resolve("Stuff worked!", conUser.countConnect++,

Angularjs Why is my Cordova Geolocation so inaccurate

I'm working on a Track & Share Module for Pilots, the app is build with AngularJS within Ionic and Cordova framework. I'm currently developting and testing for android only. The case: There are four buttons, first checks if gps is enabled, second starts the tracking, third stops the tracking, fourth send the trackdata to the web-API if internet connection is stable. I can't guarantee 100% connectivity up in the air, so I can't send the trackdata on every tracked waypoint direct to the api -

AngularJS: Select with ng-options- how to pass value as integer?

I am having an issue with my select form. When I select any option, the value that is being passed is of a string type, instead of number type. Here is my object that I use for ng-repeat: $scope.apples ={ 0:'Apple0', 1:'Apple1', 2:'Apple2', 3:'Apple3' }; And here is my select, which passes string, instead of number: <select ng-model="test" ng-options="key as value for (key,value) in apples"></select> Any ideas?

Angularjs Why is ng-repeat not displaying parent key?

I have some data set up like this: $scope.data = [ { weekDay: { monday: [{ time: '' }], tuesday: [{ time: '' }], wednesday: [{ time: '' }], thursday: [{ time: '' }], friday: [{ time: '' }], saturday: [{ time: '' }], sunday: [{ time: '' }] } }]; If I set up an ng-repeat like this... <p ng-r

Angularjs Setting up dirPagination module

Trying to set up this great looking pagination module to use for my small search app using Elasticsearch and AngularJS. What I'm trying to accomplish is to load the first 100 results on the initial search request, displaying 10 results on the page at a time. What I have on my ng-repeat(replaced with dir-paginate for this module) is <li dir-paginate="page in results.documents | itemsPerPage:pageSize" current-page="currentPage" total-items="totalItems"> With pageSize and totalItems both

Angularjs Angular material theme stays default

No matter what i do the H1 color stay white and without background color, Here is my code: <div ng-app="TestApplication"> <md-toolbar> <h1 class="md-primary">Hello world</h1> </md-toolbar> </div> Javascript: var app = angular.module('TestApplication', ['ngMaterial']); app.config(function($mdThemingProvider) { $mdThemingProvider.theme('default') .primaryPalette('red') .accentPalette('yellow'); }); codepen I'm Using : Angular - V

Testing login page AngularJS with protractor

I'm trying write e2e test for my login page. Is there any easy way to mocking my backend if I need get response with http status and username and token? I have sth like this: $httpBackend.whenPOST(apiURL + '/security/login-processing').respond(function(){ var data = {}; data.authorization = '34f47d42-d8b8-44c1-9a99-bf667d2203ec'; data.username = 'admin'; return data; }); But it doesn't work correctly..

Display in HTML sessionStorage JSON datas angularjs

I just want to know how to nicely display my sessionStorage JSON data in my html My datas are well stored in my sessionStorage like that : Bellow is my Controller app.controller('optionController', ['$scope', function($scope) { var myObject = JSON.parse(sessionStorage.getItem("flight")); $scope.getItemSS = myObject; }; }]) Bellow is how I try to display them <section ng-controller="optionController"> <ul ng-repeat="data in getItemSS"> <li>From &l

Angularjs WebStorm 11 code completion for Angular

I have been using WebStorm for Angular project, I do not get any IDE support let say defining controller as following I have checked that both Angular and AngularTemplates plugins are enabled at Settings | Plugins menu.

AngularJS - Callback after ng-repeat update

I got some trouble understanding how I make a callback after I've updated an ng-repeat. I basically want to be able to make a callback function after my updates to my ng-repeat has been finished. Currently have this: var app = angular.module('myApp', []); app.directive('onLastRepeat', function() { return function(scope, element, attrs) { if (scope.$first) console.log("ng-repeat starting - Index: " + scope.$index) if (scope.$last) setTimeout(function(){

Angularjs how to pass input ng-model to services using angular and php

im having problem for $http.get to retrieve json from input fields value from view. heres my code My form <div class="container"> <div class="col"> <div class="app-logo"><img src="img/logo.svg"></div> <div class="list list-inset removePM"> <label class="item item-input"> <input type="text" ng-model="user.username" placeholder="NRIC" > </label> <label class="item item-input"&

Angularjs parser error in html-minifier because of angular expression

I am using gulp-htmlmin thats a wrapper around html-minifier. html-minifier can't parse this angular code. <div class="col-md-4 text-center"> <span ng-if="pagination.skip + pagination.take < totalCount || pagination.skip > 0"> Viser {{ pagination.skip + 1 }}-{{ totalCount < pagination.skip + pagination.take ? totalCount : pagination.skip + pagination.take }} af {{ totalCount }} linjer </span> </div> Its the text in the span that cau

Angularjs Angular select keeps generating default missing option

I have a select being rendered inside of an agGrid. Nothing exceptionally complicated. <select ng-model="data.stdPayerClassFnbr" ng-change="vm.save(data)" style="width: 100%" ng-options="item.stdPayerClass for item in vm.payerClassList track by item.id"> </select> The crazy thing is this; I keep getting the missing value option: <option value="?" selected="selected"></option> Even though the value of data.stdPayerClassFnbr exists in the list of rendered opti

Angularjs Angular route condition for url like 2010/10

How can i write $routeProvide when condition for url like www.example.com/2010/10 ?? I have written condition like .when( '/{year:[0-9]+/{month:[0-9]+', { templateUrl: WPAngular.partials + 'archive.html', controller: 'ByYear' }) but its not working.

Angularjs Create list of items of a single item at once

Angular task 1.5.x: I have object like this: { id: 1, name: "a", items: [ {"holiday": "false", "day": "monday"}, {"holiday": "true", "day": "tuesday"...} ] } I want a new object to be created in the above way with click of a single button. Note I dont want to add each item separately, all at once. Means, for a single object with name "a", I want to add all items for all days at once. I can make it work but I want to know the correct way. ultimately we shoul

Angularjs How to render html with highcharts in ionic 2

I have tried to do this but wont able to set the positions as shown in the example what i want to do with ionic 2. fiddle example What i tried is this in my export class : this.chart1 = { chart: { type: 'pie', }, series: [{ data: [14,14], size: '100%', innerSize: '95%', }, { data: [21,7], size: '82%', innerSize: '95%', }] }, function(chart1) { var renderer = chart1.renderer,

AngularJS: HTML partials ng-if not updating when $scope.loggedInUser is updated

I am new to the AngularJS community and was hoping someone could help me with the following issue. I have created a light CMS system based on an incomplete tutorial and have filled in some of the pieces myself, but i cannot get the HTML partials to update when the $scope changes; HTML partial (admin-login.html) <div ng-if="loggedInUser"> Welcome {{loggedInUser}} | <a href="admin/pages">My Admin</a> | <a href="admin/logout">Logout</a> </div> my directive

Angularjs Angular JS URL Validation

We have to validate a value give by users for URL Field. System ask Facebook, Twitter, Google+ & etc Can anyone suggest us with best way. We are using the following pattern, /((?:https?\:\/\/www\.)|(?:[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$))/i Thanks,

Angularjs When open a modal on page load but modal open two times

I want to develop a angularjs web application where I need when url has a query string id then open a modal against the id. The modal open successfully but problem is the modal open twitch time. So Please suggest me how to prevent to open modal two times and ensure that the modal open only one time when query string has a id. My code is below: myApp.controller('othersObjectiveListController', ['$scope', '$uibModal', 'EmployeeObjectiveService', '$routeParams', function ($scope, $uibModal, Employ

Angularjs javascript THIS versus angular $SCOPE.$ON

I've been working with angular 1.x for 2 years or so. I usually follow a recipe not to get into trouble frequently. recently I started trying new approaches in order to better understand angular and javascript. I used to believe the "vm" thing I was declaring in the javascript controller was the link (bind) to the data-ng-controller="mycontroller as vm" declared in the html. I've just learned I can name them differently and the bind will still happen perfectly. Then, I decided to stop declarin

Angularjs Possibly unhandled rejection when using reject and catch with $q

I have JSON-RPC provider like this (transpiled with babel and webpack): export default function() { var id = 1; function request(method, params) { return JSON.stringify({ id: id++, method: method, params: params || [] }); } var uri; this.setup = function(user_uri) { uri = user_uri; }; this.$get = ['$http', '$q', function($http, $q) { function rpc(method, params) { return $http({

Angularjs Using Angular, how to display validation issues on an event?

I do not want to render validation issues until a user attempts to submit my form. I have a form with 2 fields, one is required and ng-minlength=5, the other is ng-minlength=5. If the fields are invalid, I would like to display them with a red background if the user attempts to submit the form. I am attempting to do this by determining the style in the controller based on the field's validity and if the submit button has been clicked. This isn't working for me though, the field never displays

Angularjs Directive controller function is not working

I am very new in angular js. I have an issue in directive. I have an ng-href from which I called the directive where in directive controller a function has written. I console the controller and it was working but the function on that is not working. This is my config.js file: angular.module('movieApp').config(['$urlRouterProvider','$stateProvider', '$locationProvider', function($urlRouterProvider,$stateProvider,$locationProvider){ $stateProvider.state('home',{ url

Angularjs Calling a service from one controller updates scope variable of another controller automatically

can anyone please help me here. https://plnkr.co/edit/vrHzXAelRlPKUrjfkYgw <!DOCTYPE html> <html> <head> <link rel="stylesheet" href="style.css"> <script src="angular.js"></script> <script src="script.js"></script> </head> <body ng-app="studentModule"> <div ng-controller="boyCtrl"> Boy: <input type="text" ng-model="name" > <br/> Add: <input type="button" value

$compile tpload in clean URL AngularJS

I have error like this Error : [$compile] tpload when i try to have clean url from here : https://scotch.io/tutorials/pretty-urls-in-angularjs-removing-the-hashtag Here is my code JS: .config(['$locationProvider', '$routeProvider', function($locationProvider, $routeProvider) { $locationProvider.html5Mode(true); $routeProvider.when('/', {redirectTo: '/datatables'}); $routeProvider.otherwise({redirectTo: '/page-404'});

Angularjs nodejs pbkdf2sync TypeError: Pass phrase must be a buffer

I am working on mean stack application. I am using crypto for password encryption but it is throwing below error. TypeError: Pass phrase must be a buffer TypeError: Pass phrase must be a buffer at pbkdf2 (crypto.js:702:20) at Object.exports.pbkdf2Sync (crypto.js:687:10) at model.userSchema.methods.setPassword (C:\CMT_Platform\server\models\user.model.js:24:24) at Object.module.exports.register (C:\CMT_Platform\server\services\auth.service.js:16:13) at exports.r

Angularjs blank <img src> custom directive in Angular JS and I was referring to this https://www.youtube.com/watch?v=R_okHflzgm0

I am new to angularjs and I was trying to create custom directive and for that I was following steps from https://www.youtube.com/watch?v=R_okHflzgm0 I did exactly what was shown here but for some reason img src is blank I dont know what is wrong in my code //created new app var myApp=angular.module('myFirstApp', ['ngRoute']); //configured routing myApp.config(['$routeProvider', function($routeProvider){ $routeProvider .when('/home', { templateUrl: 'views/home.html'

  1    2   3   4   5   6  ... 下一页 最后一页 共 421 页