Angular Dart and form validation - angularjs

Angular JS has the $pristine, $dirty, $valid, and $invalid booleans for checking the state of a form. Are there equivalents for these in Angular Dart?

Same properties will be in AngularDart, but since we are still not v1.0, we still have some missing features. This is in the works: https://github.com/angular/angular.dart/pull/372

Didn't find anything about this yet too.
EDIT
This is available and seems to work fine.

Related

How to use select2 v4.03 and AngularJS together

I would like to use AngularJs and Select2 v4.03 without adding any directives. I've researched that it's possible now with the new version of select2.
For now I've been using ui-select but it's only supporting the old version of select2 and I'd like to use the new select2 features in my application.
Can anyone please help me how is it possible to use select2 with AngularJS directly (maybe via ng-model)?
Select2 is a jQuery plugin which has a completely different approach than AngularJS native widgets (in angular these are directives) which are designed to work the angular-way from the beginning. So normally it is a good idea to use native directives if you can. If you don't find a good replacement, then you also can use jQuery elements, but you have to wrap them in an angular directive to tweak them and make them work the angular-way. This is what projects like ui-select do.
So if the newer select2 is still not available on ui-select you can wait until it is implemented. Or search for another wrapper... Or, search for a native alternative. If you haven't already I would recommend you to take a look at oi-select, for example, which I find quite good and flexible.
Update
Sorry, I just checked, and the select2 implementation from ui-select is a native angularJS implementation of the jQuery version and not just a wrapper.

parsley.js with AngularJS for form validation

I'm developing application using AngularJS (using requireJS). I want to validate input fields (basically all client side validation). I thought to use Parsley.js which looks great but it doesn't work with AngularJS. HTML5 validation overrides parsley validation.
So my questions are
1) Any idea why parsley is not working with my angular app?
2) Which is best validator for angular (except angular default validation)?
I am looking into this as well. Seems that someone on SO has created a directive to make Parsley work with Angular. Click.
The best validator, as of yet, to me seems to be the built-in Angular validation. Though multi-field validation is still a pickle.
Try this
<form role="form"
ng-submit="submit(this.form, reg)"
novalidate="novalidate" ...
to prevent native browser validation

Contenteditable directive not working with Angular UI Bootstrap Tabs

I am trying to create two tabs using Angular UI (Bootstrap), in which one tab lets the user input HTML, and the other tab serves as a "Preview", rendering the HTML provided.
To handle the preview, I am using the contenteditable directive demonstrated here.
However, this directive does not seem to be working using Angular UI tabs. I believe there may be a scope issue at play, but I haven't been able to track it down. I have already found examples of "gotchas" here, but this doesn't seem to be the issue in my case.
A Plunker of non-working code can be found here. In this example, not only is the HTML not getting rendered, but the scope updates seem to be sporadic.
Any help is greatly appreciated!
You can do this without that directive at all. You just need to use the $sce service in angular. See this plunk

How to support placeholder attribute in IE8 and IE9 without jQuery dependency in angular js?

Is there any drop in directive in angular js to support placeholder in IE 8 and IE 9. There are a bunch of libs that I found but all of them had jQuery dependency. Need to achieve it without jQuery dependency!
I managed to create a custom placeholder directive to handle it without any jQuery dependency.
I was trying to implement placeholder attributes for older browsers in an application my company was developing using our own custom placeholder directive without Jquery such as yours.
It was giving us some trouble because everytime it would just suddenly stop from working and the placeholder was taking too long to appear when using IE8/ IE9.
Then I found this guy and it works beautifully:
https://github.com/cvn/angular-shims-placeholder
Maybe you can use http://modernizr.com/ to check for placeholder suppport.
if (!Modernizr.input.placeholder) { ... }

Requiring a directive controller inside another directive

I am using Angular UI Bootstrap Datepicker. I want to add behavior to this component. According to this guide, Extending Directives, I proposed some changes to this component. Changes can be view there: GitHub PR #257.
So now, I am trying to require it inside my extension but Angular keep saying he can't find datepicker controller.
I read this thread on SO AngularJS directive controllers requiring parent directive controllers? in which the answer basically shows the same and it seems working, Fiddle.
I looked at the Angular version which is 1.0.3 in the Fiddle and I am using Angular 1.1.5.
Did this change in latest Angular version or am I doing it wrong?
According to the comments, indeed, it still works with AngularJS 1.1.5. And ended finding what was messing up. As I wanted to extend the core functionalities, I wanted to edit the original template so I used the templateUrl and provided a path to a custom template, which worked when stacking the directives but the same when requiring directives mess the things up.
Do you know how I can override original template in this context?

Resources