angularjs-ng-repeat

Angular compile template error on local project and jsFiddle, but working fine in Plunker

只愿长相守 提交于 2019-12-13 05:17:52
问题 I've noticed my angular controller is growing and have been trying to refactor and use directives and services. However, on one scenario, i am trying to create a directive which appears to be working fine in plunker, however i am seeing the following error in my local application and in jsFiddle: Error: [$compile:tplrt] http://errors.angularjs.org/1.2.8/$compile/tplrt?p0=getEmptyCells&p1= Plunker link: http://plnkr.co/edit/e11zA8LKvoPTgTqW2HEE?p=preview jsFiddle link (error can be seen in

AngularJS Filter in rails

北城以北 提交于 2019-12-13 05:11:17
问题 I'm trying to make a searchable list of posts on a ruby on rails application that I made. I have AngularJS working on the application. All of the posts are saved on rails in @posts. How would I make AngularJS filter over that? Here is the relevant view: <h1>Posts</h1> <div ng-app> <div ng-controller = "PostCtrl"> <input placeholder = "Search Post Titles", ng-model="searchText"> <div ng-repeat="post in posts | filter:searchText"> <h2>{{post.title}}</h2> <p>{{post.text}}</p> </div> </div> </div

AngularJS - Converting Incorrect Use of Service To Directive

微笑、不失礼 提交于 2019-12-13 04:23:35
问题 I have a table with a fixed width; if the data within the table exceeds the defined width, the user that the ability to scroll left and right as i have a CSS element of overflow: auto; . What i am trying to do is introduce buttons on either side of the table, so that the user can click on them, and the table will scroll to the left or right. I have achieved this using an Angular service, but on ng-click, the table only scrolls left or right once. I have a feeling this is because i have used a

How to remove duplicate value of key in angular js ng-repeat?

折月煮酒 提交于 2019-12-13 03:54:34
问题 I am using ng-repeat for array json value. But I want to remove duplicate value from UI(HTML). Like Car value is repeating, So I want to remove duplicate key value. It should be come one time. var app = angular.module('testApp',[]); app.controller('testCtrl',function($scope){ $scope.res ={}; $scope.res.fsus = [ { "statusMessageType": { "MasterConsignment": { "ReportedStatus": { "ReasonCode": "var" } } } }, { "statusMessageType": { "MasterConsignment": { "ReportedStatus": { "ReasonCode": "car"

AngularJS - Get printed value from scope inside an attribute?

痴心易碎 提交于 2019-12-13 03:45:58
问题 I'm currently working on an AngularJS project and I got stuck in this specific requirement. We have a service that has all the data, let's call it "DataFactoryService" . Then, I have a controller called "DataFactoryController" that is making the magic and then plot it in the view. Pretty usual.. <div ng-repeat = "list in collection"> {{list.name}} ... </div> So, it looks like a pretty decent app. Now, we have a requirement that pass multiple data into one element. Okay, I thought an "ng

Getting an element inside ng-init and ng-repeat

狂风中的少年 提交于 2019-12-13 02:23:25
问题 I'm trying to use ng-init to do some initialization when a particular element loads. In my template, I'm doing this: <div id="timer-0" ng-init="initTimer('timer-0', timerOne);"></div> timerOne is an object declared in the controller's scope, which looks something like this: $scope.timerOne = {...}; $scope.initTimer = function(id, timer) { var element = angular.element("#"+id); // a bunch of other stuff with the timer and element interacting with each other } Everything works fine when my HTML

Angularjs pass an array to custom filter as parameter

前提是你 提交于 2019-12-13 02:19:36
问题 When defining a custom filter in Angularjs like below I'm passing in the data set I want filtered and an array to serve as the filter values: Toggle buttons state passed in an array Parameter array value passed into the filter How the filter is called: <div class="row" ng-repeat="item in data | filterStats:filters"> The custom filter checks which values in the array should apply by filtering the data set in ng-repeat. .filter('filterStats', function () { return function (items, paramArray) {

Angularjs material or angularjs store multiple select dropdown data in webservice

﹥>﹥吖頭↗ 提交于 2019-12-13 01:16:23
问题 I am using Angular material and I am stuck on multi selection dropdown , where I was selecting more than one options and on ng-change I am calling function which will get id of every option and I will compare API id but As I select it will provide data in function like In first option selection 123456 In second option selection 123456,456231 In Third option selection 123456,456231,471258 so whenever I do compare It goes inside the condition only once and not more even I tried to split It

Displaying json data in an Angular App

我是研究僧i 提交于 2019-12-13 01:05:55
问题 I am trying to parse data from a json file and display it in my angular application, but for some odd reason the view wouldn't show the data(intepret my expressions), I thought it might be my controller, but it looks fine. Any help would be appreciated in solving this, thanks. Below is the code for my Http Service: app.factory('info', ['$http', function($http){ return $http.get('https://api.flickr.com/services/feeds/photos_public.gne?&format=json&callback=JSON_CALLBACK') .success(function

AngularJS ng-repeat applied multiple times in $compiled directive

邮差的信 提交于 2019-12-12 21:27:09
问题 I've written a directive that dynamically creates a popover for an element: app.directive('popover', function($compile, $timeout){ return { link: function(scope, element, attrs) { $timeout(function() { // grab template var tpl = $(element).find('.popover-template') // grab popover parts of template var template = { //$compile( $(element).siblings(".pop-content").contents() )(scope) title: tpl.find('.template-title').contents(), content: tpl.find('.template-content').contents() }; // render