New Project - Using Angular 1.x or Angular2 + sparkjava + material design

Asked

Viewed 1,244 times

0

I would like to use the angular2-material but not yet left, I can not postpone the project so I have to choose, duration of the project some 2 years so stay the next 2 years at angular 1.x or use angular 2 with the light design material? http://www.getmdl.io/components/index.html " have few components"

One man project, I come from the classic Asp, doing everything in jquery+boostrap bringing/taking json from/to the server and mounting everything on the front type "Singlepage"

Below an example of one of these things: "I’ve always been proud" but when I saw the power of angular ai was passion for the thousandth view [I still find it very verbose] + 2 improved a little:

/**
 * Form Submit
 * HTML exemplo:
 * 	<form action="/login" method="post" data-submit> ... </form>
 * JS:
 * 	$(function() {
 * 		$('form[data-submit]').formSubmit({
 * 			sucesso: function(resp){
 * 					... trata retorno aqui
 * 				},
 * 			falha: function(resp){
 * 					... tratar retorno aqui
 * 				}
 * 		});
 * 	});
 */
$.fn.formSubmit = function(opt) {
   		var form = $(this);
		$.ajax({
    	  type: form.attr('method'),
        	url: form.attr('action'),
        	data: form.serialize()
	      }).done(function(resp) {
	    	  // load function
	    	  //console.log(resp);
	    	  (opt.sucesso(resp));
	      }).fail(function(resp) {
	    	  // load function
	    	  //console.log(resp);
	    	  (opt.falha(resp));
	      });
}

  • Welcome to the SOPT. The way your question is at the moment, and very likely that the community considers it mainly based on opinions, that is, each has a different view of what should be done/used. Edit your question to make it more objective and with a well-defined purpose. See here how to ask.

1 answer

1

As I also came from good old jQuery, migrating to the AngularJs no chances of going back, before proceeding with the answer, I would like to ask a question, as it will set the course that - I at least - I advise you to follow.

What is your knowledge of AngularJs 1 today?

If the answer is anything other than advanced up, I recommend that you strongly consider using the ng2.0 (ng = Angular). I say this because the difference between ng1 and ng2 is very blatant in all respects. Roughly speaking, it’s like 2 completely different languages. The way you program in ng1 and ng2 have similar fundamentals but different practices. So you better start and learn the ng2 than starting in the ng1 for the simple fact of owning a visual library of design material. That’s just a detail.

What good is a pretty picture if you don’t have a house to hang?

What you’d be missing if you didn’t use material2.0, would be only superficial functionalities, such as slide drawer, tooltip, FAB, etc. What you would be missing if you don’t use the ng2, would be performance, technological delay, simplicity and code organization, etc..

The scale weighs too much for one side.

I understand when you say Project of a single man, but there are others frameworks of design material that can give you all the visual aspect, without the superficial functionalities, which can also be achieved with ng2 and animations css3. They may not be so modular, but they certainly supply your need.


Now, if you already have a good knowledge in ng1, I see no problem in you continue using the same. As much as the ng2 beta be there, version 1 will still have a good amount of support time, enough for us to migrate to ng2 more calmly and calmly. Without putting the cars before the oxen. And then yes, you can use the 2 libraries to create a well harmonious project.

I hope the answer will clarify your doubt and guide you better.

  • Thank you, it was very enlightening, forward is that if you walk, I will walk in this direction ng-2.

  • @Everaldolima as I already have a very large base of projects, I will still be in ng1.. But I gave myself a period of 6 months to start changing.. It’s a very big change and a bigger learning. But surely the benefits are great too. = D Glad I could help.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.