Using angular from amber

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Using angular from amber

laci
Some colleagues of mine are using angular to develop web applications.
I wonder if amber could serve as development environment for angular applications.
 
Basically you decorate the html with some angular directives, like that:
  <div ng-controller="TodoCtrl">
    number of items: {{todos.length}}
  </div>

Next you define the controller in JavaScript.
Within the controller the model is declared among others.
  <script type="text/javascript">
    function TodoCtrl($scope) {
      $scope.todos = [
        {text:'learn angular', done:true},
        {text:'build an angular app', done:false}
      ];
    }
  </script>

The angular framework takes care of binding the view with the model via the appropriate controller.

I wonder how one would write the JavaScript part with amber.

Thanks in advance.
Reply | Threaded
Open this post in threaded view
|

Re: Using angular from amber

Herby Vojčík
I tried to make amber work with Angular, and it's really hard. I decided to drop Angular completely instead, and wrote angular-inspired (though much less strong, as angular have team and Google backing) trapped.

Angular's style of heavy reuse of Object.create()-based inheritance and lot of one-of-a-kind inline objects is incompatible with Smalltalk class-centric view (in fact, only thing that bugs me in Smalltalk after spending so much time with JavaScript are classes :-) ).

Maybe you will find a way. For me it seemed not worth the energy.

Herby

laci wrote:

> Some colleagues of mine are using angular to develop web applications.
> I wonder if amber could serve as development environment for angular
> applications.
>
> Basically you decorate the html with some angular directives, like that:
>    <div ng-controller="TodoCtrl">
>      number of items: {{todos.length}}
>    </div>
>
> Next you define the controller in JavaScript.
> Within the controller the model is declared
among others.

>
>
> The angular framework takes care of binding the view with the model via the
> appropriate controller.
>
> I wonder how one would write the JavaScript part with amber.
>
> Thanks in advance.
>
>
>
> --
> View this message in context: http://forum.world.st/Using-angular-from-amber-tp4695799.html
> Sent from the Amber Smalltalk mailing list archive at Nabble.com.
>

--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.


Reply | Threaded
Open this post in threaded view
|

Re: Using angular from amber

laci
Herby,
Pretty much agree with you. Angular looks like a waste of time. It is cumbersome and the only interesting bit is model binding. For that though Knockout is a better choice.

Thanks for sharing your experience.