24

Does anybody know a library or project that allows for an AngularJS style of programming in Dart?

I'd like to be able to create annotated HTML files for declaring my UI instead of imperatively instantiating everything like in SWT. Also, features like data binding would be helpful. Can I use Dart for that instead of JS?

0

5 Answers 5

20

angular.dart - official port of Angular to Dart.


Old answer:

Another option: Web UI. There's a new article on it here.

Sign up to request clarification or add additional context in comments.

Comments

4

The angularjs team announced a port for Dart a couple of days ago

Here you go the link http://news.dartlang.org/2013/06/angularjs-announces-port-for-dart.html

Comments

1

You should check out Buckshot from John Evans. Buckshot gives you declarative UI and data binding. https://github.com/prujohn/Buckshot

4 Comments

Buckshot has it's own Xaml-style templating system. AngularJS uses HTML and gives ability to extend it. Due to this AngularJS applications seems more natural imho.
@ArtemAndreev While AngularJS solves the data-binding problem nicely for HTML, it does not solve certain extensibility challenges. Try to extend HTML Button, for example, such that it has new behaviors and appearance. You can't directly. You have to tag it with some class and then let a javascript find it, add hooks, UI transformations, etc. Buckshot's abstraction seems foreign at first, but when you start to see what's coming soon with web components in HTML5, you'll see that it's not so strange. Buckshot's extensibility allows the Xaml-like base elements to be transformed into anything.
@JohnEvans May be I misunderstood you in something. But AngularJS has nice ability to extend HTML syntax using directives. You no need to tag it with some class and then let a javascript find it, add hooks, UI transformations, etc. And I can use new elements and attributes in conjunction with other standard HTML elements and attributes, ie I no need to create and use textblock, border, etc. As far as I understand AngularJS uses HTML and extends it, and Buckshot replaces HTML with something like XAML.
@ArtemAndreev Xaml is the starting point, but the extensibility afforded by Buckshot via Dart means that you can create your own schemas, suited to your application. Take StackPanel for example: If you didn't like the name you could just extend it like so in Dart: "class Stack extends StackPanel {}" (in fact I have done this in a recent commit). That's all that needs to be done. I'm not saying that Buckshot is the right solution for everyone. Much of it depends on your background. .net people tell me they love Buckshot, whereas traditional web developers take longer to warm up to it. :)
1

There are a bunch of UI frameworks being created for Dart right now. I know about PureMVC, Buckshot, and HipsterMVC, but there are probably others. I don't know which of these are like AngularJS.

Google also just released an article on using Web Components in Dart.

3 Comments

its hard to do that without support for reflection. any idea when that is going to come?
Reflection already works, to some degree. It's called the mirrors API.
I found out that the mirrors API doesn't yet work with dart2js :(
-2

AngularJS uses the new methodology of MVC (Model-View-Controller) to separate information from the user interface. Many web frameworks, most notably Ruby on Rails and ASP.NET MVC 3 and MVC 4, use this methodology to make programming web apps easier, in my opinion. JavaScript libraries, like AngularJS and Backbone are beginning to use this style of programming on the client-side as well. For Dart, I would take a look at Hipster MVC. Its still being developed, but it looks very promising and should be completed soon. Hope this helps!

2 Comments

MVC was invented no later than 1988.
Actually it was invented a decade earlier - heim.ifi.uio.no/~trygver/themes/mvc/mvc-index.html, but yeah, it's not quite new :)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.