the.jmcnet.team | 15 Nov 23:52 2014
Picon

Re: [angular.js] use another library with angular

It would be great if you can provide a code example ! I'lm running the same case.
How to wrap in a service ?

JM.

Le jeudi 31 mai 2012 22:40:59 UTC+2, Alexander Kohlhofer a écrit :
Thank you! I referenced the wrong thing so it was not working. Silly me. I may follow up for pointers for wrapping it into a service but for now all good. Thanks again!


--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscribe <at> googlegroups.com.
To post to this group, send email to angular <at> googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.
Caleb Sandfort | 15 Nov 23:47 2014
Picon

$resource http response code 0?

Hi

I'm working on a cordova app using ionic and angular.  I've been using $resource to make rest requests to a MVC Web Api project that I'm hosting.  Everything has been working great and I've had no issues with performing rest requests.  All of a sudden today, the rest requests are erroring almost immediately and when catching the error, the status code is 0 and the status text is "" when using the app on my android phone.  What makes it really weird is that they still work when I hit the app using Chrome on my desktop machine.  Has anyone experienced this issue before or know what this status code/text combo signifies?

Any help would be appreciated.

Thanks

--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscribe <at> googlegroups.com.
To post to this group, send email to angular <at> googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.
Дима Давидов | 15 Nov 23:39 2014
Picon

ajax in angularJS

how to make smth like this: 

http://www.poseti.net/otpravka-formyi.html

in angularJS?

some.java.developer | 15 Nov 16:03 2014
Picon

Events from $broadcast and $emit not propagated on an Element directive.

Hello,

I have a custom directive that works fine when used as an attribute directive (angular version 1.3.2).
When I try to switch it to an Element, then the events from other services and controllers that are sent with $broadcast and $event (depending if they are up or down in the DOM hiearchy) are no longer propagated when they are triggered from inside the template, or from other services. Events just seem to be ignored.

There should not be any difference if the directive is used as an Element or as an Attribute right?
Or am I missing something here?

I have something like:

<div id="contentBottom" ng-controller="navigationControler as selectionBottom">
<div navigation-block="contentBottom"/>
<table class="listing narrow" ng-controller="tableController as tableBottom"> 
<thead>
 <tr>
... 
</tr> 
</thead> 
 
<tbody>
<tr table-content-row="contentBottom"></tr>
</tbody>
</table> 
</div>

This works fine, all events that are triggered from the table directive get propagated to the navigation controller.
So when working with an attribute directive, all works fine.
But when I change the navigation-block to an element like this:

<div id="contentBottom" ng-controller="navigationControler as selectionBottom">
<navigation-block navigation-block="contentBottom"/>
<table class="listing narrow" ng-controller="tableController as tableBottom"> 
<thead>
 <tr>
... 
</tr> 
</thead> 
 
<tbody>
<tr table-content-row="contentBottom"></tr>
</tbody>
</table> 
</div>

then events are no longer working.
Is this expected behaviour, or is there something else I need to change when working with element directives?
The controller name is used to make a datalist id unique, so if this works for an attribute, it should make no difference for an element - it is the same template.


If you really want to know what is inside the template, here it is:

<div class="ym-fbox">
<div class="backButtonBlock"><a href="#" class="folderUpLink" ng-click="parentFolder();">&nbsp;<img class="folderUpImage" ng-src="../img/icon_up_small.png" src="icon_up_small.png"/></a></div>
<div class="selectorBlock">
<input type="text" id="locationTop" name="locationTop" ng-keypress="showNewLocation($event);" ng-model="location" style="width: 100%" list="{{controllerName}}Locations"/>
<datalist id="{{controllerName}}Locations">
<option data-ng-repeat="favorite in favorites" value="{{favorite}}"/>
</datalist>
</div>
</div>



The directive is defined like this:

selectionModule.directive('navigationBlock',
 ['$log', 'selectionData',
  function($log, selectionData) {
 return {
 restrict: 'AE',
 link: function(scope, element, attributes) {
// Normally this will contain the name of the controller.
scope.controllerName = attributes.navigationBlock;
 },
 replace: 'true',
 templateUrl: 'angular-templates/navigation-block.html'
 };
  }
 ]
);

I really don't see why this would make a difference for the events, since the hiearchy in the DOM model does not change.

--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscribe <at> googlegroups.com.
To post to this group, send email to angular <at> googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.
Alex Mouton | 14 Nov 22:36 2014
Picon

Svg Custom Directive

Hi Folks!

I have been working lately on using Angular to generate SVG.
I have some cool things working, but In pursuing an ng-show animation problem Ive come up with this simple fiddle:
http://jsfiddle.net/alexmouton/8xy26L6h/
  two rects, one static and one generated by a custom directive.
  both rects show up on inspection, but the directive one doesn't render?

The only difference I can see is some user-agent styling.
In my app I have all sorts of svg elements being driven by angular, including rects, so I'm at a loss.

Do you have any insight?

Thanks
Alex Mouton

--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscribe <at> googlegroups.com.
To post to this group, send email to angular <at> googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.
Joberto Diniz | 14 Nov 14:04 2014
Picon

Angular.ui modal flip animation

Hi, I'd like to implement flip animation using Angular.ui modal.
Something like this: http://images.thoughtbot.com/angular-modals/transitions.gif (reference)

Did anyone already implement (using angular.ui)?

--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscribe <at> googlegroups.com.
To post to this group, send email to angular <at> googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.
John Chacko | 14 Nov 12:35 2014
Picon

Model out of Controllers sample not working

this is with reference to the concept in below blogs

http://toddmotto.com/rethinking-angular-js-controllers/?

http://jonathancreamer.com/the-state-of-angularjs-controllers/


where it talks about keeping Model out of Controllers and service taking are of Model.

I tried below sample and it seems missing array by reference, so now updating results.

http://jsbin.com/qeratubero/2/


--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscribe <at> googlegroups.com.
To post to this group, send email to angular <at> googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.
Marlon Glaciano | 14 Nov 11:37 2014
Picon

[AngularJS] Inscrições abertas para voluntários do Agile Trends 2015

Bom dia pessoal!

As inscrições para voluntários do Agile Trends 2015 estão abertas.

Acessem o link abaixo:
https://www.facebook.com/AgileTrends/photos/a.489270857809241.1073741828.464326573637003/754999067903084/?type=1&fref=nf

Qualquer dúvida, é só falar!

Abraços,
Marlon Glaciano

--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscribe <at> googlegroups.com.
To post to this group, send email to angular <at> googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.
Kevin Huang | 14 Nov 07:10 2014
Picon

back-end data caching

New to here. Sorry if I post question at wrong channel.

We are using angularjs+pyramid. Our web needs to show a table read from an endpoint which is seldom updated. Is there anyway to cache the data on client side to reduce the communication to back-end? If the data is cached, what is the best way to get the updated data (like periodically polling)? Any suggestion is appreciated. Thanks a lot! 

--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscribe <at> googlegroups.com.
To post to this group, send email to angular <at> googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.
Kai Yang Tay | 14 Nov 07:03 2014
Picon

Looping of promise array to retry websocket connection.


"use strict";

angular.module("socketExample",[])

.service("socketExampleService", ["$timeout", "$interval", "$q", 
                         function($timeout, $interval, $q){
var sock = null;
var promises = [];
var cnt = 1;
var initialize = function() {
var deferred = $q.defer();
$timeout(function(){
sock = new WebSocket("someWebSocketUrl");
sock.onopen = function() {
console.log("Successful");
$interval(function(){
sock.send("");
}, 5000);
};
sock.onmessage = function(event) {
// do something
}
sock.onclose = function() {
console.log("closed");
};

sock.onerror = function(err) {
console.log("error");
};
deferred.resolve(true);
} else {
deferred.reject(false);
}
}, 1000);
return deferred.promise;
}
this.setup = function() {
promises[0] = initialize();
var exitLoop = false;
var maxRetries = 5;
        while(promises.length < maxRetries && !exitLoop) { // remove this while-loop - works!
    
        promises[promises.length - 1].then(function(result){
if(!result) 
promises[promises.length] = initialize();
                        else
                                exitLoop = true;
}, function(reason){
promises[promises.length] = initialize();
});
        }
}
}])

;


Hi I am trying to setup a websocket to auto retry connection. The reason of why I am doing this is because my "someWebSocketUrl" url is asynchronously retrieved from another XHR service.

I was thinking of controlling the retry by setting a set of promises[] array, so that if any one fufill the promise. The code will exit, and the websocket will be established.

But when I try to run this piece of code, my chrome browser crashed. 

When I remove the while-loop in setup(), it works. 

I do not understand why the code dun work when it starts to loop. Is it wrong to use promise this way?

--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscribe <at> googlegroups.com.
To post to this group, send email to angular <at> googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.
AxelD | 13 Nov 23:22 2014
Picon

Angular.js -- i18n/L10n: Suggestion on pluralization and gender dependant strings

Hi,

I've watched the impressive presentation by Rahul Doshi.

Yet, looking at the ... well ... clumsy way of pluralization and gender dependant strings I'd like to suggest an alternative:

Here's the suggestion:

Have the JSON localization string files not just contain a string per key but an object of strings:

{
myMessage: {n: ['No one applied for it.', 'One person applied for it.', '%number persons applied for it.']  // gender agnostic (neuter) [0, 1, other]
  m: ['No man applied for it.', 'One man applied for it.', '%number men applied for it.']         // male [0, 1, other]
  f: ['No woman applied for it.', 'One woman applied for it.', '%number women applied for it.']   // female [0, 1, other]
 }
}

With default logic applied for simple texts:

{
myMessage: 'This string fits all cases.'
}


Gender agnostic:

{
myMessage: ['Nothing to declare.', 'One piece to declare', '%number pieces to declare.']
}


Quantity agnostic:

{
myMessage: {n: 'It\'s a child.',
  m: 'He\'s a man',
  f: 'She\'s a woman'
 }
}


And mixtures of it:

{
myMessage: {n: 'The police came.',
  m: ['No police men came.', 'One police man came.', '%number police men came.']
  f: 'Female cops arrived.'
 }
}




Don't you think this might help keeping things clear?

I believe this will be much more concise than the "data-count"/"data-when" approach.

And this way of setting messages also would support different layouts for different languages.

Regards,
Axel Dahmen

--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscribe <at> googlegroups.com.
To post to this group, send email to angular <at> googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Gmane