|
ManoliIsFat posted:Then again, I don't know your exact requirements, so maybe you do need socket.io for the data to be pushed from the server instead of you polling it constantly. socket.io can use longpoll or Flash or a bunch of transports, IIRC. It really was a wonderful "just works" experience across N browsers and whatnot when I last used it (~2 years ago).
|
# ? Apr 17, 2014 00:11 |
|
|
# ? May 18, 2024 05:27 |
|
Any clue why an angular filter would throw too much recursion errors into the console/firebug?
|
# ? Apr 21, 2014 22:33 |
|
an skeleton posted:Any clue why an angular filter would throw too much recursion errors into the console/firebug? I'm going to go with too much recursion on that one. Post code.
|
# ? Apr 22, 2014 00:32 |
|
Is there a mobile framework/library with nice looking page transition effects? All the ones I've found look like crap, or don't support swiping, or are too slow on mobile I made this demo of the kind of thing I'm looking for http://static.holloway.co.nz/catalyst/swipe-pages/
|
# ? Apr 29, 2014 23:43 |
|
N.Z.'s Champion posted:Is there a mobile framework/library with nice looking page transition effects? All the ones I've found look like crap, or don't support swiping, or are too slow on mobile http://demos.jquerymobile.com/1.2.0/docs/pages/page-transitions.html Best I've been able to find.
|
# ? Apr 30, 2014 16:16 |
|
I attended a talk tonight on a framework called Durandal. It was given by the framework author himself. Towards the end of the presentation, he revealed that he's been hired onto the Angular team as an external consultant and is working to incorporate a lot of the ideas from his framework into Angular 2.0. He wouldn't give any sort of timeframe for a release, though. A post announcing his hiring and his hopes for the partnership.
|
# ? May 1, 2014 05:10 |
|
jkyuusai posted:I attended a talk tonight on a framework called Durandal. It was given by the framework author himself. Towards the end of the presentation, he revealed that he's been hired onto the Angular team as an external consultant and is working to incorporate a lot of the ideas from his framework into Angular 2.0. He wouldn't give any sort of timeframe for a release, though. He also mentioned it on the Angular blog a few weeks back: http://blog.angularjs.org/2014/04/angular-and-durandal-converge.html I'm really looking forward to seeing what the two become in Angular 2. I recently got a job doing front-end development and I went straight from "gently caress I dunno what any of this is" to Angular and haven't looked back.
|
# ? May 3, 2014 02:43 |
|
Speaking of Angular, I have a question. I'm using ng-repeat to make an unordered list, and I know that basic "sort" and "filter" functions with that, but what I'm trying to do is custom sort is so that a certain match is at the top, a certain match is at the bottom, etc. I know that it's possible to create a custom filter, but I'm not sure how to get started in re-ordering and returning a re-ordered list. If it were just an array or something I'd be fine with switching items around but for some reason connecting that with ng-repeat is stumping me.
|
# ? May 5, 2014 15:41 |
|
http://pastebin.com/AjhizPLf https://docs.angularjs.org/tutorial/step_02 I'm messing around with some of the tutorial on AngularJS and a SaaS framework called ServiceNow. The objects GlideRecord, encodedQuery, query, next(), are all part of the ServiceNow framework. Line 14-16 works fine but line 19-27 doesn't. Looking into the debugger, it looks like the objects being pushed in line 24 don't have a hashkey while line 16 does have one. The parameters for hi2.name gets passed fine. Any ideas on how to fix this? e: nvm got it Geno fucked around with this message at 01:01 on May 8, 2014 |
# ? May 7, 2014 07:53 |
|
I started playing around with Angular today and am obviously still very new to it and want to make sure I'm doing things the right way. I have basically a "master" page that has a navigation bar and a <ng-view> to dynamically load content. I'm doing so by simply calling a different page that I've configured in the router. It works, however I notice when viewing the html source for the page it's still just showing my master page and not any of the new page information. Is this normal or a problem in any way? If so, what's the correct way to handle a master page?
|
# ? May 8, 2014 08:38 |
SuicideSnowman posted:I started playing around with Angular today and am obviously still very new to it and want to make sure I'm doing things the right way. I have basically a "master" page that has a navigation bar and a <ng-view> to dynamically load content. I'm doing so by simply calling a different page that I've configured in the router. It works, however I notice when viewing the html source for the page it's still just showing my master page and not any of the new page information. Is this normal or a problem in any way? If so, what's the correct way to handle a master page? When you use the old school "View Page Source" it shows you the original HTML that was loaded for the page and doesn't reflect any changes made by JavaScript. You'll want to use the Developer Tools instead. Right click somewhere on your page and go to Inspect Element and it should open it up. (it's gonna blow your mind if you've never seen it before)
|
|
# ? May 8, 2014 08:43 |
|
fletcher posted:When you use the old school "View Page Source" it shows you the original HTML that was loaded for the page and doesn't reflect any changes made by JavaScript. You'll want to use the Developer Tools instead. Right click somewhere on your page and go to Inspect Element and it should open it up. (it's gonna blow your mind if you've never seen it before) That makes sense and I know about inspect element but I guess the whole concept of dynamically changing views is weird to me since I've been primarily using Asp.NET MVC and switching to different views is essentially reloading a new page. I've gotta say I'm really liking this so far. There's quite a learning curve though and don't want to start off by learning bad habits and inefficient practices. I'm building a fairly large application that involves a lot of client side manipulation and while Asp.NET was working for me (with a lot of help from jQuery and knockoutJS) it was starting to get a little unruly. I'm hoping the time it takes to learn Angular will allow me to create a better application in the end.
|
# ? May 8, 2014 08:58 |
|
Not really sure how to Google for this, but for modern Javascript, what kind of style recommendations are there for quotes vs. double quotes? Sometimes people seem to use double quotes extensively. Others use single quotes. I cut my teeth on C-like languages and Perl, so by habit I tend to only use double quotes for interpolation or escaped characters, but I wondered if modern JS has other conventions?
|
# ? May 9, 2014 19:36 |
|
This is probably a dumb question (and may not be in the right thread), but I'm really new to trying to use express.js to create a little webapp. I've got a bunch of different routes set up in app.js like so -code:
I don't really know much about MVC either, which I think is hurting my understanding of this whole issue.
|
# ? May 9, 2014 19:50 |
|
Kobayashi posted:Not really sure how to Google for this, but for modern Javascript, what kind of style recommendations are there for quotes vs. double quotes? Sometimes people seem to use double quotes extensively. Others use single quotes. I cut my teeth on C-like languages and Perl, so by habit I tend to only use double quotes for interpolation or escaped characters, but I wondered if modern JS has other conventions? Pretty sure it doesn't matter 99% of the time, although I believe double quotes are technically part of the JSON spec. Otherwise you can use either and it depends more on your own conventions than anything. I like using single quotes in JS because I've always used double quotes in HTML. When I need to construct some markup in JS it means I don't have to constantly escape every single double quote.
|
# ? May 9, 2014 19:50 |
|
Kobayashi posted:Not really sure how to Google for this, but for modern Javascript, what kind of style recommendations are there for quotes vs. double quotes? Sometimes people seem to use double quotes extensively. Others use single quotes. I cut my teeth on C-like languages and Perl, so by habit I tend to only use double quotes for interpolation or escaped characters, but I wondered if modern JS has other conventions?
|
# ? May 9, 2014 20:13 |
|
Interesting, thanks. You ask people about tabs vs. spaces, or braces at the end of the line vs. braces on a new line and all hell breaks loose. With quotes, it sounds like it's basically personal preference.
|
# ? May 9, 2014 22:12 |
|
Kobayashi posted:Not really sure how to Google for this, but for modern Javascript, what kind of style recommendations are there for quotes vs. double quotes? Sometimes people seem to use double quotes extensively. Others use single quotes. I cut my teeth on C-like languages and Perl, so by habit I tend to only use double quotes for interpolation or escaped characters, but I wondered if modern JS has other conventions? I worked on a project long ago that used double quotes for user-visible text and single-quotes for internal strings, like identifiers, so that's what I do now. I acknowledge it's a weird personal rule and I don't really give a poo poo if people submit code to my projects that break the style.
|
# ? May 10, 2014 02:17 |
|
If you use jshint (perhaps in a grunt task like me) then it will bitch and moan about any strings in double-quotes being wrong. Apparently that thing only likes single quotes for...everything.
|
# ? May 10, 2014 07:07 |
|
Top Quark posted:If you use jshint (perhaps in a grunt task like me) then it will bitch and moan about any strings in double-quotes being wrong. Apparently that thing only likes single quotes for...everything. "quotmark": false, man http://www.jshint.com/docs/options/#quotmark
|
# ? May 10, 2014 08:42 |
|
If you're working with JSON, use double quotes for the property names. If you're working with strings of HTML via JS, use single quotes so you don't need to escape every double quote. Otherwise, do whichever you prefer (or your team has agreed to use). Either way, just be consistent.
|
# ? May 11, 2014 18:19 |
|
So I've been using React thanks to this thread and I love love love love it. It's the poo poo. I think the thing I like the most is the attitude it takes and tries to push on the developer of breaking things into smaller pieces. That's how I write software in general and what I push people I work with to doing. I have the opportunity to give a presentation on React for a fun check-out-this-new-technology meeting at my office. After just leading the charge to implement SPA frameworks (Angular) into some of our more complex forms one of the things I'm going to be grilled on is "Angular Vs. React". I hate those types of question and I if I'm understanding React correctly React is mostly there for making a rad rear end view layer. It's not a huge fat assed routers and controllers and-and-and-and SPA. I've been taking notes on the official React website and from Maluco Marinero's posts (thanks!) but I'm trying to come up with a list of things I can research that React does better than Angular. If anyone knows of some stuff I can read up on or more stories of React successes (I know there's a few in this thread) I'd really appreciate the guidance. I think it makes view layer design easier. I like making cute lil components I can repeat. I know it's supposed to be super fast (hello Angular $watch), but I haven't done anything too crazy with React. Also, React is the best. Even knowing I'm not 100% nailing best practices and am terrible as any person new to any technology I'm loving this. It's my best bud. My presentation has candy, glitter, and I used wacky scissors to cut stuff out. It's going to be the best like React. Go learn React.
|
# ? May 12, 2014 13:44 |
|
Yep, been there, although we had some clear hair on fire problems that made the switch from Angular to React a no brainer. Performance primarily, we had a view that once the data set rose to a certain size we had pages taking 35 seconds to render in Angular + slow down for every action. My React performance test got that down to 3 seconds with more potential optimisations to be had, and from their I was pretty much told to go for it. As for how they stack up for my mind: Angular is good boilerplate, and very efficient on developer time for simple single page apps. It comes with plenty of batteries included so you can build something quick. However the boilerplate is almost non optional, which makes it heavy in structure. The way templates can be encoded with powerful logic can encourage a lot of bad reuse patterns that splits your codebase into lots of dependant chunks. That's not to say you can't make good reusable components in Angular, I just feel its poorly set up for it with global DI namespaces, splits between templates and code, and just a lot of tricks and gotchas to learn when you start to do things more complicated than simple bound forms. Combined with some truly dreadful performance in complex scenarios, Angular doesn't end up saving developer time, and that gets worse the more that project deepens in complexity. This is the key issue that I feel React has a better answer for, as a whole: Its fast by default. Its easier to optimise from 3 second render times than 15 second render times, and if you're planning to go on mobile you need every default optimisation you can get. What works well on desktop with Angular can choke quickly with limited CPU and wasteful watch checks. Its component driven with rigid definition of interfaces. The Property/State model actively protects the separation of concerns so you end up with components that can be reliably tested and composed into larger structures. Logic is also concentrated in JavaScript, rather than spread across HTML templates and JavaScript. It has good allowance for testing. Recent versions have a suite of test utilities in Addons that make it dead simple to simulate events, detect sub components, etc. It also all goes back to being component driven, its easy to know all the dependencies and mock up effectively for testing. There are less concepts to learn. React is much more concise in what it does and does not do. As a consequence the docs are well written, can be read completely in a single sitting if you wanted to, and are easy to browse. Meanwhile over in Angular land creating directives, the primary method of component reusability is such a heavy concept with lots of different stages and settings that renders the finer points hard to work with. React dev has a slower output of functionality than Angular dev, but React components are longer lived and easier to develop cleanly, which over time results in a structure that allows you to make quite significant changes to functionality without the change having wide ranging implications. While that is possible with Angular, its arguably more difficult because of how easy you can end up with a tangled design without realising it. Angular's freedom ends up being a bit of a straight jacket. So React might be slower to develop for in the short term, in the long term you'll have a stable and easy to predict velocity thanks to a more developer friendly framework. As for the batteries included bit, there are tonnes of libraries that do <x> better than angular. Some picks from me: DateTime: momentjs Translation: i18next Keyboard: mousetrap Promises: bluebird Utilities: lodash ...but there's a ton out there so take your pick.
|
# ? May 13, 2014 17:22 |
|
Thanks a lot for typing that out, means a lot. I also appreciate the inclusion of libraries at the end. I just so happen to be using lodash for the demo I'm using and I'm definitely going to check out those other ones you included. Thanks again.
|
# ? May 13, 2014 17:31 |
|
moctopus posted:Thanks a lot for typing that out, means a lot. Also, if you want routes then there's also the obviously-named react-router-component library. It ends up adding a couple of useless divs to the page but lets you define all kinds of fun stuff.
|
# ? May 13, 2014 17:40 |
|
I've been wrestling with AngularJS the past few months, trying to make an ~interactive experience~ for listing a bunch of SQL data. My wish is to make it possible to create hardlinking URLs, so I can get to page 3 or whatever if I type in my.url/#/page/3 and I assume the way to do this is to use routes. So I've been using routes! This seemingly has the additional benefit of letting users get to the right page when they hit the browser's Back button. There are problems cropping up, though. For one, AngularJS will reload the route's controller every time you request a page, and this means the browser has to tear down the entire DOM of 5000 nodes or whatever, and rebuild it again with the new data. On a mobile device, this can take up to 5 seconds, which is possibly because I'm a retarded developer. I made a test-version where I just have the backing data itself replaced, without using routes, and it's about 10x faster to flip "pages" this way, but the trouble is, as I've mentioned, that it makes it harder for the user to just copy the current URL for future reference. My brilliant idea to solve this was to manually change the URL with $location.path() to match the displayed content, but this automatically gets AngularJS to reload the controller, which of course tears down the DOM and I'm back to square one. Another irritating problem from a usability standpoint is that the teardown and rebuild of DOM means the browser can't maintain scroll positions when you hit the Back button, which makes it a chore to check out individual entries and going back to the list, etc. Does anyone know if there's a Proper Way to handle pagination like this?
|
# ? May 13, 2014 20:26 |
|
Essentially you want to prevent angular's router from firing at all if you're currently within that controller. Not something I've done before but look at this: http://uiadventures.wordpress.com/2013/09/06/routechange-angularjs/ On top of that you manually need to make use of push state to add support for the back button. As you observed any use of the default router will scrub the DOM within ng-view, load a fresh template, load the controller and then compile the template. The only way to stop that happening is to keep the controller in charge if there's a matching change of route. Phone posting but hopefully that's enough to make a start?
|
# ? May 14, 2014 06:19 |
|
Maluco Marinero posted:Phone posting but hopefully that's enough to make a start? Thanks, I'll have a look at it and see if I can mangle it into something usable. Seems such a common dilemma, though.
|
# ? May 14, 2014 22:20 |
|
As we've had a decent amount of discussion around React lately, I'm debating tearing the React component I built around the Select2 jQuery widget out of the project I'm working on and putting it up on github so people can get an idea on how to use jQuery stuff with React. I've got to do some work on it to make it a bit less tailored to exactly what I'm doing is the only reason I haven't just done it. Is anyone interested in seeing that?
|
# ? May 14, 2014 23:52 |
|
Yes.
|
# ? May 15, 2014 01:59 |
|
KARMA! posted:Yes.
|
# ? May 15, 2014 02:26 |
|
Thermopyle posted:Is anyone interested in seeing that? The React team is.
|
# ? May 15, 2014 03:11 |
|
darkgray posted:There are problems cropping up, though. For one, AngularJS will reload the route's controller every time you request a page, and this means the browser has to tear down the entire DOM of 5000 nodes or whatever, and rebuild it again with the new data. You might also want to look into https://github.com/angular-ui/ui-router It lets you nest views so you can update an inner view (and the url) without reloading the outer view. Here's a demo: http://plnkr.co/edit/u18KQc?p=preview
|
# ? May 15, 2014 13:40 |
|
KARMA! posted:Yes. Subjunctive posted:The React team is. Ok, I don't know how good this is as I've only been fooling around with React for a month and JS for hardly any longer, but... There's a demo here. Link to the Github on that page as well. If anyone wants to work on it and help flesh it out I'm game for some pull requests or whatever.
|
# ? May 15, 2014 22:46 |
|
Where do people put their Angular (or whatever) template files? They have to be accessible from the web right? Currently my project is laid out like this: code:
|
# ? May 16, 2014 17:18 |
|
fuf posted:Where do people put their Angular (or whatever) template files? You could rewrite requests without a referrer (?) to templates/ back to the main page of the app. Edit: hastily answered this on my phone. Not sure about it. fuf posted:Also does google crawl those files? Google will attempt a request with #! replaced as a query parameter ?_escaped_fragment_= So no it won't crawl them iirc. Though I may have a robots.txt with my partials/ directory in it. The escaped fragment parameter would allow a public facing angular site to redirect google to statically cached pages via rewrite rules.
|
# ? May 16, 2014 18:42 |
|
So I've been using AngularJS for a little over a week now and I'm starting to get a better understanding of it. I'd just like to say that making "multi-page" forms are a lot easier than my previous methods using jQuery. I say multi-page in quotes because I don't really want separate forms for each page but just a separation of different divs to keep things organized. Previously in jQuery I would have to create different divs with IDs of "page1", "page2", etc. Then I would .hide() all the pages I didn't currently need. After that a button would .hide() or .show() the different pages. It always seemed like a fairly hacky solution that would sometimes create content flashing and other anomalies. In Angular I'm simply using the ng-switch directive and using $watch to watch a currentPage variable. Whenever the variable changes (based on a button click) it automatically updates the ng-switch directive with the necessary page. A much more elegant solution I must say. While I'm sure there was a better way to handle it in jQuery I doubt it would have ever been this simple.
|
# ? May 17, 2014 22:36 |
|
FED friends, this is a super basic thing that I've gotten to work before but i can not for the life of me figure out why it's not working right now. It's a .NET environment for a web app and i'm just trying to do a simple class exception for IE but when I look at it in IE it does not seem to be working. <!--[if !IE]><!--> <body class="@(ViewData("bodyClass") & " " & IIf(Me.IsMobile(), "bt-mobile", ""))"> <!--<![endif]--> <!--[if IE]> <body class="@(ViewData("bodyClass") & " " & IIf(Me.IsMobile(), "bt-mobile", "" & "ie"))"> <![endif]--> Is there something glaringly wrong with this? (besides that I am using .NET haha)
|
# ? Jun 4, 2014 22:00 |
|
HTML5 posted:Is there something glaringly wrong with this? (besides that I am using .NET haha) Which version(s) of IE? IE 10 and later don't honor conditional comments unless you're forcing them into quirks mode.
|
# ? Jun 4, 2014 23:18 |
|
|
# ? May 18, 2024 05:27 |
|
Molten Llama posted:Which version(s) of IE? IE 10 and later don't honor conditional comments unless you're forcing them into quirks mode. Yeah this is the problem. I had no idea this was a thing so this makes sense now. I ended up fixing it the correct way without having to use an IE conditional. Flexbox rules when it works the way it's supposed to!
|
# ? Jun 5, 2014 00:33 |