Profile

Cover photo
Thomas Coopman
126 followers|521,046 views
AboutPostsPhotosYouTube

Stream

Thomas Coopman

Shared publicly  - 
1
Add a comment...

Thomas Coopman

Discussion  - 
 
 
Restangular just got more love in the latest release of this REST API for AngularJS.

http://www.blogeek.com.ar/2013/04/26/new-features-on-restangular-the-ultimate-rest-api-client-for-angularjs/
8
1
Davide Lazzari's profile photo
Add a comment...

Thomas Coopman

Discussion  - 
 
I've got a question about reloading of directives when using ngView.

This is my setup:
* ngView to switch between views
* one view has a directive (+service) that has a high cost of setting up, and has some state that I want to remember when switching between views.
* I keep all the state in the service.
* The component that I have to setup and want to cache (Arcgis map) needs a div at construction time. So when switching for the 2nd time the map is already constructed and I cannot attach the div again.

At the moment I have a solution to return the map and do element.append but this is not very clean because the 2nd time I switch to the map, there will be 2 nested divs with the same id.

Should I fix this with compile or something else? Or is using views here not the best solution?

Example: http://plnkr.co/edit/LKAyLwV69EQqgLl5LzEx?p=preview

In the example, I want the user to be able to use the map (zoom, pan) and when he switches back and forth, the map must remember his position.
1
Thomas Coopman's profile photo
 
I've found a solution by doing:

    var par = element.parent();
    element.remove();
    par.append(map.container);

I'm not sure if this is the best solution but it works
Add a comment...

Thomas Coopman

Discussion  - 
 
What do you think about this? One example: http://docs.angularjs.org/guide/dev_guide.unit-testing
 
Wow, the +AngularJS docs are not in very good shape. There are a bunch of paradoxes, unexplained issues, discussions in the comments that desperately need answering, missing pages, pages out of order, outdated or just plain wrong practices and more.

Hoping to be able to contribute soon, but I do feel like the team should slow down development and focus on solidifying version 1.0 first, docs inclusive.
6
Horia Cristescu's profile photoBrian Campbell's profile photoKees de Kooter's profile photoalex knol's profile photo
6 comments
 
I'd like to see more examples. Nothing should be without an example or two. I've been frustrated with the docs too.
Add a comment...

Thomas Coopman

Shared publicly  - 
3
Add a comment...

Thomas Coopman

Discussion  - 
 
 
The +Adobe Developer Connection just posted this article on Getting started with AngularJS.  Follow it to build a snazzy photo viewer.  http://www.adobe.com/devnet/html5/articles/getting-started-with-angularjs.html

Interesting quote:

One notable characteristic of the application is just how little JavaScript code needed to be written...It's also important to note something that is absent. The JavaScript is completely devoid of code that manipulates the DOM. This characteristic of AngularJS makes it very different from many other JavaScript frameworks. This feature means it's much easier to build soundly architected applications with clear separation between application logic and view rendering.
5
4
Add a comment...

Thomas Coopman

Discussion  - 
 
I have some questions about best practices and reusable components in AngularJS.

I have a directive that sets a variable in the scope of my controller. What is the best way for the controller to wait for the variable to be set. In the example that I've made (based on http://angular-ui.github.com/ - google maps), I've added an init method to the controller. When the directive has set the variable ($scope.myMap) it calls the init method (scope.init() on line 38).

My problem with this solution:

* there is a tight coupling between the directive and the controller. (Every controller needs an init method to use this directive).

(At the moment there is also tight coupling between the view (attrs.uiOptions) and the directive, but that looks clean to me, the coupling between the directive and the controller does not.)

Solutions for this problem:

* the current solution is fine.
* the controller waits for an event fired by the directive (not sure how to do this yet).
* the controller waits (active wait) to see when myMap has been set.
* others???

I'm also wondering about the best way to extend the functionality of the directive, for example if I want to wrap some methods of esri.Map. Lets say I want to rename setLevel to setScale (toy example).
I could put this in the controller, but with reusability in mind, this does not look very clean.

Example: http://plnkr.co/edit/KCod5XpP7N6qMpmERT68?p=preview
1
1
Maurycy Gosciniak's profile photoPawel Kozlowski's profile photoThomas Coopman's profile photoMagnús Örn Gylfason's profile photo
17 comments
 
+Maurycy Gosciniak Thanks, I've used this to get the my basic example working. At the moment I'm struggling to get the uiEvents working, it doesn't work for me. I'm guessing that it has something to do with the dojo events of the ArcGIS Map API but haven't found a solution yet.
Add a comment...
Have him in circles
126 people
Scott Arenz's profile photo
Jo Bridts's profile photo
Joke Coopman's profile photo
Toon Vanreppelen's profile photo
Jan Verwilligen's profile photo
Veronique Verhofstede's profile photo
Tom Gyssels's profile photo
Michiel Trimpe's profile photo

Thomas Coopman

Shared publicly  - 
 
 
I'm blown away by the new photo search in Google+ where it's recognizing subjects in my own photos -- here the various times I've run into snakes while hiking.

It's unbelievable how the state of the art in computer vision has progressed recently. And I can't imagine the amount of number crunching that must have gone into all this picture processing!
1
Add a comment...

Thomas Coopman

Shared publicly  - 
 
Finally! I was using it already for a long time, but now it's out officially in Belgium.
 
Hey Austria, Australia, Belgium, Ireland, Luxembourg, New Zealand and Portugal, get ready to rock! Google Play Music has arrived  on your #Android (goo.gl/q5gzs) and on the web (goo.gl/khSe7). Store up to 20,000 songs on Google Play for free and stream to your devices for instant listening, anywhere.
1
Add a comment...

Thomas Coopman

Discussion  - 
 
I have a question about unit testing with Angular, mostly about unit testing services.
I've set up a basic example http://plnkr.co/edit/HMWvQsBNax4gn8lTi1Ys

My question is the following, how do I test the toTest function that depends on the deferred to be triggered. I can call the set function first but would rather not because set depends on some other things.

Some of the options I can think of:

1. Call set first so deferred is resolved. Set can depend on many other things.
2. add deferred to _export
3. make the function in then a named function, add it to _export and test that function
4. ????

What do you think are the best options? None of these options seem very clean to me.

Thanks!
1
Josh David Miller's profile photoThomas Coopman's profile photoalex knol's profile photo
6 comments
 
+Thomas Coopman It was just an example. You could do any asynchronous service in a similar way. If your toTest functionality is encapsulated in a service, then you can just mock out that service because it gets tested independently. Otherwise, if it is part of the same service, I think you just have to call them both. Is there an issue with calling both?
Add a comment...

Thomas Coopman

Discussion  - 
 
Great article about the new (starting from version 1.1.4) ngAnimate directive: 
http://www.yearofmoo.com/2013/04/animation-in-angularjs.html

ngAnimate looks very nice, going to try this out myself soon!
49
9
Siegfried Hirsch's profile photoTim Jagodzinski's profile photoMaximilian Hoffmann's profile photoTony Brown's profile photo
5 comments
 
Nice as espected from yearofmoo
Add a comment...

Thomas Coopman

Discussion  - 
 
I've created a directive to include a public google+/picasa album in your angular site. You can find the code here: https://github.com/tcoopman/angular-picasa and see and example here: http://daa.chiro.be (this website is in dutch).

If you have suggestions to improve it, let me know.
10
1
Lee Olayvar's profile photoPascal Precht's profile photoGavin Mogan's profile photo
3 comments
 
Looks quite nice, but I would make transclusion possible in the directive so that a user can decide how the markup a picasa album should look like. Then you could also use an isolated scope, to view this whole thing more as a reusable component.
Add a comment...
Basic Information
Gender
Male