The fundamental issue is that some browsers will return an empty string
when a numeric input type has invalid data, therefore angular will only see
an empty string and consider the element valid.
The sample you posted works in firefox for me, but not in chrome.
Some workarounds would be to
.
On Sun, Feb 16, 2014 at 12:29 PM, Daniel Tabuenca
dtab...@gmail.comjavascript:
wrote:
Your list is fine, but I question the usefulness of compiling an
exhaustive list of every time that $digest is called, especially since
third-party directives could add additional services and callbacks
Declaring private/internal functions and variables like you did is
perfectly legitimate use of Javascript. You can even declare functions like
this:
function controller( $scope ){
$scope.var;
var myvar = 'Hello world';
function myfunction(){
alert('Hello world');
}
}
--
You received
The actual resume of compile is when you call $compile, not when you link
the result. You have to make sure you don’t resume until you added the
attribute you want in the link function.
.directive('foo', function($compile) {
return {
restrict: 'A',
priority: ,
terminal:
I’ve done it both ways and I think they are both valid ways of doing it.
The easiest, is obviously just loading everything and showing/hiding tabs
based on which one got clicked. If you are using ZURB, the common thing to
do is to use their markup, but write the actual behavior in angular.
Having a complex system of watches and event handlers to try to keep data
in sync is usually too much complexity with very little return value.
On the other hand, we’d like to stay true to the “principle of least
knowledge” (or law of demeter), and only give each section access to the
data
You simply need to quote the string and access it using the array syntax:
ng-show=create_form['phones['+$index+'].number'].$dirty
That being said, is there a reason why you have to name forms like that?
Are you submitting these forms to the server through a standard form post
and require
You can use a pre-link function instead of the default post-link function
like this:
app.directive(log, function() {
return {
link: {
pre: function(scope, element, attrs) {
console.log(PRE LINKED + attrs.name);
},
post: function(scope, element, attrs) {
The problem is in your blur handler. Here's the sequence:
1. You select the cruel word
2. You click on the **bold** button
3. The blur event gets triggered
4. ctlr.$setViewValue(Hello cruel editable world!) is called but since
the value is the same as it was before, the view is not re-rendered
Cross posting from SO:
I’m not trying to be snarky, bu I really do think you are mis-understanding
the purpose of the $httpBackend that is in the ngMockE2E module.
This is not a matter of opinion, the ngMockE2E module is simply not
designed nor intended to be used from within a jasmine
I'm not sure how MD5 would prevent the kind of attack he is proposing
though. If the hacker has access to script source and can poison caches
they would presumably be able to edit the invocation of any MD5 hash
encoding and otherwise do anything else the application is normally allowed
to do.
But this calculation is client-side. If the attacker has full access to
client-side scripts, they can easily ajax in the server-script, run an md5
on it and return that (while what's actually executing on the browser is
the compromised script).
On Thursday, January 2, 2014 9:33:06 AM UTC-8,
Yeah, just want to make sure the original poster understands that MD5 will
not solve the particular scenario he presented. SSL would go further, but
still he should still be fully validating any request on the server.
--
You received this message because you are subscribed to the Google
A few things to consider:
If checkboxHandler is meant to be a generic directive where what is done
when something is changed can vary, then you would pass in the method to
call in your HTML and wire it up through the isolate scope of your
directive.
If checkboxHandler is always meant to use
Yeah, that might be a good idea to suggest on the dev list. `ng-transclude`
is a very simple and naive directive. I can imagine many situations where
it would be hard for it to know what you mean without being explicit about
it.
--
You received this message because you are subscribed to the
Yeah promises are great because they map perfectly with the asynchronous
nature of the browser platform. Netflix has been very successfully using
promises on the server side as well. Almost all of their server-side
services are promise-based which has proved invaluable to adapting to
Angular starts at the root node of the application (where ng-app is) and
goes down the tree node-by-node. For each node it encounters it tries to
determine all the directives that are on that node. If it finds multiple
directives on one node it will order them by greatest to least priority
I’ve spent some time with the angular code today looking at how
transclusion is implemented, and it can get pretty complicated.
The ng-transclude directive is pretty simple, it just takes the transclude
function injected into the current context and calls it. However, when you
have a
I was able to see some of the previous code in the plunker history. I don’t
know if it will solve your problem or not, but it’s probably better to
compile the label and then attach it to the dom when you call its link
function. Something like:
var label= angular.element('label
Using HTTPS for serving scripts can help prevent man-in-the-middle
attacks, and provide assurance that the script that is being executed came
from the server specified in the SSL certificate.
Angular js is no different than any other client-side technology, however,
and the browser should
I'm sure there is plenty of people using angular with grails, but you will
get a better response if you ask your specific question, since angular
problems or issues are similar no matter what back-end you use.
On Monday, December 30, 2013 3:17:44 PM UTC-8, Mauro Sanna wrote:
none?
On
Angular expressions do not allow arbitrary javascript. They are intended to
access properties an methods on a scope (not global properties such as
navigator). In order to get what you are trying to do to work, you would
have to move that logic into a controller method. For example:
There’s two notions at play here, one is object-oriented programming (which
javascript handles quite well), the other is a static typing system (which
javascript being a dynamic language doesn’t natively support).
It’s important to understand that you can do object-oriented programming
In your controller injection list you are missing “products”. The array of
strings for dependency injection needs to match the number of parameters
into your controller function:
*This:*
var productDetailController =
catalogControllers.controller('ProductDetailController',
['$scope',
I see where you are coming from. You have an established set of patterns
which work well for you. However, in many ways angular makes a lot of these
patterns potentially unecessary, and by adopting new patterns more aligned
with the angular way of doing things, you can greatly reduce the
There are likely other problems with your code preventing it from working,
but just to be sure *you do need to include ‘product’ in your DI injection
array*.
The DI injection arrays are not just for services, but for anything that
needs to be injected by name. You can get away with not using
Yes, directives are fairly low-level. In that sense, saying that they
“solve too many problem spaces” is like saying “functions solve too many
problem spaces”. As I pointed out in the last post, they are simply a way
to bind javascript to DOM, and they exist to make it easy to create
This is a common question/concern by those seeing angular for the first
time. In a sense, it seems as though we’ve gone backwards in time when we
used to do things like:
div onclick=doSomething()
About the time that jquery started becoming popular, a lot of the
web-development community got
Controllers are stored as data in each of the directive’s respective dom
nodes. They are accessed by using the .controller('directiveName') method
of angular’s jqLite wrapper.
While the controller('directiveName') method will walk the tree upwards
starting at the current dom element until it
Because of the way you have set up multiple watches inside and outside your
directive, you’ve managed to expose a bug that I have fixed in the 1.2.x
series:
https://github.com/angular/angular.js/commit/2d0f6ccba896fe34141d6d4f59eef6fba580c5c2
30 matches
Mail list logo