Amber Smalltalk vs Angular JS

200 views
Skip to first unread message

askoh

unread,
May 4, 2014, 8:26:19 PM5/4/14
to amber...@googlegroups.com
I hear a lot about Angular JS. How does Amber and Angular compare and
contrast? How close are we to having Smalltalk on the server and Smalltalk
on the client for web distributed computing?

Thanks,
Aik-Siong Koh



--
View this message in context: http://forum.world.st/Amber-Smalltalk-vs-Angular-JS-tp4757887.html
Sent from the Amber Smalltalk mailing list archive at Nabble.com.

H. Hirzel

unread,
May 5, 2014, 5:11:25 AM5/5/14
to amber...@googlegroups.com
Hello Aik-Siong Koh

On 5/5/14, askoh <as...@askoh.com> wrote:
> I hear a lot about Angular JS. How does Amber and Angular compare and
> contrast?


Which field of application do you have in mind?

For example https://angularjs.org/ shows a ToDo application on the front-page.

We could compare it to a Amber ToDo application. I recently updated
Rodrigo Bistolfi's version to Amber version 0.12.4 and check out where
the differences are.

https://github.com/hhzl/Amber-ToDo-List

Regards
Hannes

askoh

unread,
May 6, 2014, 1:14:45 AM5/6/14
to amber...@googlegroups.com
I want to create a Lists of Lists browser for recipes, todo lists,
hierarchies, etc. The LOL browser will create, populate, manipulate, delete
lists and sublists inside a web browser. But the LOL is save on the server.
Preferably, I want to use Smalltalk for as much as possible.

Thanks,
Aik-Siong Koh



--
View this message in context: http://forum.world.st/Amber-Smalltalk-vs-Angular-JS-tp4757887p4758012.html

H. Hirzel

unread,
May 8, 2014, 5:40:52 AM5/8/14
to amber...@googlegroups.com
Hi Aik-Siong Koh

Your question is how does Amber compare to Angularjs. My answer is
that I cannot say it yet.

I don't know if you have tried out angularjs yet. It has a ToDo app
on the front page of the web page. The code is pretty compact as you
can see in the copy below.

I have updated Rodrigo Bistolfi's ToDo app for Amber for the latest
Amber 0.12.4.

http://hhzl.github.io/Amber-ToDo-List/

(It uses localStorage to store the ToDo list).

Amber uses more code and not so easy to understand unless you know the
Seaside HTML rendering system.

For a list of list app you have an example in the Smalltalk browsers.
List of packages, list of classes. You can use that as an example to
implement your generic list of list app.

It would be great to have a list of list app both in Amber and
angularjs to compare side by side.

In case you need Amber support please don't hesitate to ask on this list.

Regards
--Hannes



--------------------------------------------------------
Angularjs ToDo app html
--------------------------------------------------------

<!doctype html>
<html ng-app>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.7/angular.min.js"></script>
<script src="todo.js"></script>
<link rel="stylesheet" href="todo.css">
</head>
<body>
<h2>Todo</h2>
<div ng-controller="TodoCtrl">
<span>{{remaining()}} of {{todos.length}} remaining</span>
[ <a href="" ng-click="archive()">archive</a> ]
<ul class="unstyled">
<li ng-repeat="todo in todos">
<input type="checkbox" ng-model="todo.done">
<span class="done-{{todo.done}}">{{todo.text}}</span>
</li>
</ul>
<form ng-submit="addTodo()">
<input type="text" ng-model="todoText" size="30"
placeholder="add new todo here">
<input class="btn-primary" type="submit" value="add">
</form>
</div>
</body>
</html>


--------------------------------------------------------
JavaScript
--------------------------------------------------------


function TodoCtrl($scope) {
$scope.todos = [
{text:'learn angular', done:true},
{text:'build an angular app', done:false}];

$scope.addTodo = function() {
$scope.todos.push({text:$scope.todoText, done:false});
$scope.todoText = '';
};

$scope.remaining = function() {
var count = 0;
angular.forEach($scope.todos, function(todo) {
count += todo.done ? 0 : 1;
});
return count;
};

$scope.archive = function() {
var oldTodos = $scope.todos;
$scope.todos = [];
angular.forEach(oldTodos, function(todo) {
if (!todo.done) $scope.todos.push(todo);
});
};
> --
> You received this message because you are subscribed to the Google Groups
> "amber-lang" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to amber-lang+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

ph...@highoctane.be

unread,
May 8, 2014, 6:23:40 AM5/8/14
to amber...@googlegroups.com
On Thu, May 8, 2014 at 11:40 AM, H. Hirzel <hannes...@gmail.com> wrote:
Hi Aik-Siong Koh

Your question is how does Amber compare to Angularjs. My answer is
that I cannot say it yet.

I don't know if you have tried out angularjs yet.  It has a ToDo app
on the front page of the web page. The code is pretty compact as you
can see in the copy below.

I have updated Rodrigo Bistolfi's ToDo app for Amber for the latest
Amber 0.12.4.

    http://hhzl.github.io/Amber-ToDo-List/

(It uses localStorage to store the ToDo list).

sebastian

unread,
May 8, 2014, 7:47:41 AM5/8/14
to amber...@googlegroups.com

On May 8, 2014, at 6:40 AM, H. Hirzel <hannes...@gmail.com> wrote:

It would be great to have a list of list app both in Amber and
angularjs to compare side by side.

yes, and we need to take a little care on code and app aesthetics because they’ll be opinion shapers

If we show we can do the same but we’re, say twice easier to understand, then we’ll have a great point


Reply all
Reply to author
Forward
0 new messages