未加星标

282 RR Angular on Rails with Jason Swett

字体大小 | |
[前端(javascript) 所属分类 前端(javascript) | 发布者 店小二05 | 时间 2016 | 作者 红领巾 ] 0人收藏点击收藏

Charles: Hey everybody and welcome to episode 282 of the Ruby Rogues podcast, this week on our panel we have a new Rogue, Jerome Hardaway.

Jerome: Hi everybody, calling live from San Francisco with General Assembly and Dream Force. Really happy to be having this opportunity and be able to connect with the Rogues out there.

Charles: Awesome. We also have a special guest this week and that’s Jason Swett.

Jason: Hello.

Charles: I think I forgot to introduce myself. I’m Charles Max Wood from Devchat.tv. This week we’re gonna be talking about Angular on Rails. Jason, do you wanna give us a brief introduction to yourself and then I will get started talking about Angular and Rails.

Jason: Sure. My name is Jason Swett, I’m the author of the angularonrails.com, I’m historically a Rails’ developer, I’m teaching myself Angular over the last little while and as I’ve been teaching myself Angular, I’ve been teaching it to other people as well.

Charles: Nice. I think Jerome you also mentioned that you’ve done some Angular.

Jerome: Yes. I actually used Angular and Rails to teach better in style of code. I used to work a lot in using Angular and Rails for the past couple of years. That definitely is a great front end connector for your Rails app. I love it.

Charles: Awesome. I’m curious, is your experience mostly with Angular 2.0 which has been out for I think three weeks now or is it Angular 1.0?

Jerome: For me or the guest?

Charles: For both of you.

Jerome: Angular 1.0 for me, 1.0 or 1.5 I guess I could say, I haven’t really dived into Angular 2.0 yet. I don’t know Swett, is your tutorial, is that Angular 2.0 now?

Jason: Yes. It’s Angular 2.0. Pretty much, all of my production and Angular experience is Angular 1.x. almost everything that I’m doing, going forward with angularinrails.com is Angular 2.0 because I figured, for the people who are just coming into it, they’re gonna mostly invest their time and to learn Angular 2.0. Angular 1.0 is definitely not going away at any time soon. I wanna have some kind of balance but of stuff I’ve been doing lately is Angular 2.0.

Charles: Alright. I think we’re all familiar with Angular but let’s assume that or listener is familiar let’s say with Rails but not with Angular. Why would somebody want look in this something like Angular, why not just do things the Rails way.

Jason: Good question. I actually think that, in a lot of cases, you should just use Rails and you don’t have to use front end framework like Angular in all cases. I’ll kinda describe the cases in which you might want to.

Over the last several years, the web has evolved and the expectations of web users have evolved. We’ve gone from having static websites to having richer and richer, more interactive web applications. Those web applications evolved more and more javascript.

As you do that, you have so many Ajax requests and so much front end logic and stuff like that and it’s very easy to let that run away from you and end up with a huge amount of Spaghetti code.

In my mind, one of the benefits of Angular is that it gives you places to put things and it gives you some structure for your front end portion of your application so that you don’t automatically end up with a mess. You can still end up with a mess even if you do use Angular but it gives you slots to put things. That’s one part of it and the other part of it is just it makes all this interactivity a lot easier than if you’re coding all the stuff from scratch.

Jerome: Roger that. I was gonna actually piggyback on that. One of main reasons that I’ve been using Angular on Rails is for a more dynamic webplus. As you see, the interactivity on the web has like you said exploded and what was a novelty is now come the expected by the end user.

Live information, data modelling just come into front end and that’s one of my main reasons why I use Angular. I was a little intrigued on if you were ever going to expand on that Angular tutorials for users. Are you coming out with a book or anything in that regard?

Jason: Well before I answer that, expanding which part exactly do you mean?

Jerome: Expand on more the real time data modelling that you can do with Angular when it comes to information and actually having it show or search like a fuzzy search, things with that nature. Are you gonna be implementing more of that into your tutorials?

Jason: Good question. That kind of stuff is more detailed than the stuff I’ve been covering so far. What I’ve been covering so far is just the super, most basic stuff like how do I even set up an Angular Rails app at all.

That’s actually really not a straightforward question and answer you know because there’s a number of different ways you can do it and a lot of different decisions you have to make.

When it was Angular 1.0 and I was building my first Angular in Rails app, this is like 2013 or 2014 that I was getting started with that combination. I was like, “Okay, how do I structure my Angular application? Where do I put stuff?”

I don’t think at that time we had what now was I think was thede facto standard, now I think it’s officially blessed as the standard that John Papa Angular Style Guide. That didn’t exist or at least I didn’t know about it back then. Everybody just kinda structured their Angular application, however their dev team decided to. There’s really no direction.

That was one thing and then it’s like, “Okay, do I structure this as like a client server architecture where Rails is just purely an API and then I have the client side like maybe even in a separate repo or do I put Angular in the asset pipe?” There’s so many decisions you have to make just before you even get to square one and you can have a hello world app.

That was one of the first things that I documented. I think what I ended up choosing was, and I don’t do it this way anymore, but what I used was Gulp with Yeoman. Yeoman was kind of the key component to the way I was spinning up my Angular 1.0 apps because they have a command that you could run and generate in Angular app.

It would give you a directory structure and to me that was great because a lot of people who comes from a Rails’ background have the philosophy of like, “I want the framework to be opinionated and to make most of the decisions for me. I want there to be one right way to do stuff even if I might not necessarily agree with the one right way to do stuff. At least everybody’s doing it the same way.”

One of the really nice things about Rails is that if you jumped into any Rails project, chances are that it’s gonna pretty much look like most of

本文前端(javascript)相关术语:javascript是什么意思 javascript下载 javascript权威指南 javascript基础教程 javascript 正则表达式 javascript设计模式 javascript高级程序设计 精通javascript javascript教程

主题: AjaxJavaScriptGulpJavaRuby
分页:12
转载请注明
本文标题:282 RR Angular on Rails with Jason Swett
本站链接:http://www.codesec.net/view/485536.html
分享请点击:


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 前端(javascript) | 评论(0) | 阅读(25)