|
I'm getting back into web design after a 7-8 year hiatus. My god, I knew things had changed but after reading the OP and talking to a couple friends it's obvious that I'm going to have to toss out all of my old knowledge and start over. Frameworks, CSS preprocessors, HTML5, grid-based layouts...I feel like I'm in way over my head. How do I pick one framework over another if I don't have any experience with any of them? I checked out some reviews of PHP-based ones and plan on giving Yii a try, but then someone introduced me to AngularJS and React and now it feels like I could spends months considering my alternatives and still not be able to decide. Should I just pick popular frameworks and learn them? Are frameworks mutually exclusive - would I use AngularJS with Laravel, for example? Edit: I should mention that I'm comfortable with HTML/CSS/JS/PHP/etc... but I've never used a framework before and the last time I did any development it was alright to render pages on the server. I'm now coming to understand that RESTful APIs are now king, and that client-side frameworks are designed to pull content from server-side frameworks that expose the API. IAmKale fucked around with this message at 02:47 on Jan 24, 2015 |
# ¿ Jan 24, 2015 02:19 |
|
|
# ¿ May 17, 2024 20:56 |
|
I just found out recently that Github has a system in place to host static websites for free. I've been paying for personal hosting for years but since I've just been using it recently to host a static personal page I'm thinking of moving my domains over to Google Domains and switching the couple of static sites I have over to the Github pages system. If I were to do that, though, what would be my best option for temporary web-facing server access? For example, if I develop a dynamic website locally and want to show it off to someone, should I just spin up an Azure or AWS LAMP instance and pay for however long I need it up to show off my work? Since REST is king is there some kind of website or service I can use if all I want to do is set up a DB to store data and process API calls? This scenario has been the main reason I've kept my hosting around but if I can find a way to gain server functionality only when I need it for less than $60/yr then I'll be a happy camper.
|
# ¿ Jan 27, 2015 01:30 |
|
revmoo posted:Check out Sagonet. I pay 30 bucks a month for a dedicated server. Had it for a couple years now and downtimes have been pretty minimal.
|
# ¿ Jan 27, 2015 02:41 |
|
kedo posted:Yeah, it's maybe a half step better than Geocities was. I see designers apply for jobs with Wix portfolios on occasion and they're painful to look at and use.
|
# ¿ Jan 31, 2015 01:11 |
|
I have an odd question about hrefs to CSS files with respect to AngularJS, .htaccess, and a bookmarked route. While trying to figure out how to get rid of index.html in Angular URLs I discovered Angular's html5mode. After enabling this I discovered that going directly to a route (i.e. http://myapp.com/event/1) returns a 404 because the server doesn't know to return index.html for all requests. This led me to the following .htaccess file: code:
However! Something strange happens with these direct links: namely, my index.html's stylesheet won't load if don't include a forward slash at the beginning of the href: HTML code:
HTML code:
You can see the weird behavior here (I've taken out the preceding forward slash in the code): https://calendar-angularjs-masterkale1.c9.io/ > click an event, everything looks fine vs https://calendar-angularjs-masterkale1.c9.io/event/1
|
# ¿ Feb 3, 2015 03:32 |
|
Alright, so it's just a matter of relative versus absolute paths. I probably would have experienced similar issues with JavaScript files not using absolute paths if I had anything on /event/ that Angular needed to respond to. I guess that's one of the benefits of single page apps - everything can be linked from an absolute path since index.html powers everything.
|
# ¿ Feb 3, 2015 04:25 |
|
v1nce posted:You would have probably seen this if you checked dev-tools while still using the relative paths - namely a 404 for the CSS files at "/youre/doing/it/wrong/css/main.css".
|
# ¿ Feb 3, 2015 15:44 |
|
v1nce posted:That shouldn't make any difference. How is this image defined? Can you show me the code? code:
IAmKale fucked around with this message at 07:43 on Feb 4, 2015 |
# ¿ Feb 4, 2015 07:22 |
|
down with slavery posted:The logo path is an absolute path. It starts with / IAmKale fucked around with this message at 07:45 on Feb 4, 2015 |
# ¿ Feb 4, 2015 07:42 |
|
ynohtna posted:You have <base href="/"> in your head so all relative paths are relative to site root. It doesn't affect your CSS declaration which comes before it.
|
# ¿ Feb 4, 2015 16:50 |
|
Are there any database hosting services that will help me to quickly get an API service up and running for cheap/free? I want to start practicing development with AngularJS but I'm feeling overwhelmed since I also feel like I have to simultaneously learn something like the Django REST Framework first before I can proceed. I'm just looking for something I can use in development to auth against and store data. Once I get comfortable with the Angular I figure I can then move on to Django and learn that at my leisure.
|
# ¿ Feb 5, 2015 16:20 |
|
Cross-posting from the Front-end Developers thread, can anyone give me some advice on how I might improve my Firebase Auth service to better convey error messages to AuthController? The tutorial I was working through uses an older version of the AngularFire so I had to update the code to work with the new authentication API calls. I'm having an issue where errors are caught in the Service, so the Controller has no idea that anything's gone wrong unless I check for an error every time the function is called. Here's the start of my Auth service: code:
code:
code:
|
# ¿ Feb 10, 2015 00:36 |
|
Is there any recommended reading on how best to store/structure data in a NoSQL database? I'm pretty comfortable with SQL and relational databases but NoSQL is like the wild west to me. For example, foreign keys don't appear to really be a thing so it seems easy to inadvertently end up with duplicated data all over the place. Edit: v1nce posted:If you still want Auth.error to be present, then there's no problem in keeping that around in the service for other things to access if they're interested (think of it as "lastErrorThatOccurred"). But if you can deal with the promises directly and capture the errors usefully, there's no reason to keep it around. IAmKale fucked around with this message at 18:58 on Feb 10, 2015 |
# ¿ Feb 10, 2015 18:01 |
|
revmoo posted:The whole point (correct me if I'm wrong pls) of a nosql db is that there is no relational data. You're either storing high-performance key/value data or unstructured documents. If you need relations you use something else. As far as I know the only way to get something like foreign keys to work would be in your application database wrapper. Which seems fine to me--keep your rdbms and key it in software to whatever nosql solution you need for that portion of your data. We actually do this at work to coorelate memcached values to data in our Postgres DB.
|
# ¿ Feb 10, 2015 19:27 |
|
How can I copy to the clipboard the JSON object representing my Firebase auth object? I've been console.log()'ing it so I can see it in Chrome's Developer Tools but I need to see the whole thing in straight JSON format so I can figure out why my Firebase security rule isn't working. Edit: is there an IRC channel for web dev? IAmKale fucked around with this message at 02:43 on Feb 24, 2015 |
# ¿ Feb 24, 2015 02:35 |
|
I tried that, it choked on "circular object". I found what I needed under the Resource tab > Local Storage, though.
|
# ¿ Feb 24, 2015 03:59 |
|
I've come across what I think is an async-promises related issue in an Angular app I'm playing with. I'm currently using AngularFire to handle logins with Firebase. I have a NavController that controls stuff in the site's navigation bar. Since the site is pretty barebones at this point I just have a basic template that shows the site's name as well as a logout link when the user is logged in:code:
code:
The reason I think this is an async issue is because I make a second async call to grab the user's profile from Firebase after I get back the authData object. I then add the results of that second call to authData so I have user profile information available wherever I need it. What I'm thinking is happening is that I'm getting back the initial auth payload which has enough info to determine if the user is logged in, but the username assignment happens before that second async call finishes so nothing can be assigned. What can I do to get this to work? I know about resolving things in the router, but I'm not sure if there's anything similar for controllers.
|
# ¿ Feb 24, 2015 06:30 |
|
Hey guys, am I opening myself up to anything if I use a Firebase with read/write rules set to False at the top most level, and then authenticate as an admin in a Python script that's intended to interact with the database? As in, is that a bad habit to get into? I'll eventually open it up for reads from Angular but for now it'll just be a means of storing and retrieving API keys for another service.
|
# ¿ Mar 6, 2015 17:47 |
|
Is ng-book still the go-to reference book for people who want some Angular-oriented literature to read? I was all eager to buy it until I saw the reviews on Amazon - a fair amount basically say this is the Angular API copy-pasted into book format with lovely editing and organization of the content surrounding the examples.
|
# ¿ Mar 23, 2015 22:32 |
|
Hed posted:I personally got far more out of the Orielly one. Each has a very small half-life with Angular 2 on the horizon imo, but I'm lazy.
|
# ¿ Mar 23, 2015 23:57 |
|
edit: poo poo, I keep forgetting about the Django thread
IAmKale fucked around with this message at 23:56 on Apr 13, 2015 |
# ¿ Apr 13, 2015 23:39 |
|
I'm working on my first API right now (using Django Rest Framework) and I have a general question about crafting a usable API. First off, I'm trying to make this API for a webapp that could potentially be used by employees from multiple companies. Obviously I need to set up permissions to prevent employees from Company A from modifying entries for Company B. Right now I've been working with verbose routes like /companies/1/locations/2/requests. However, I realized this morning I could simplify things and just make a basic /requests/ route and then use the employee's token (that they're submitting for authentication) to look up the employee's company and/or location. The simpler route would also make it easier for SPA's to interact with the API as no one would have to know what company or location an employee is when CRUD'ing requests. Is this a good design decision? IAmKale fucked around with this message at 18:50 on Apr 16, 2015 |
# ¿ Apr 16, 2015 18:45 |
|
What's the best Angular-centric way of storing an auth token for API calls? I have an API up and running and handling logins, but now I need to write up a service to handle logging in and verifying the token is available. Should I just use plain HTML5 localstorage?
|
# ¿ May 4, 2015 17:55 |
|
I'm writing my first serious Angular SPA using the NGBoilerplate style as the foundation and I need help figuring out how to access constants defined in one module from another module. Basically, I want to access the USER_ROLES constant defined in my main module from another module. Here's my main module code:
code:
quote:Error: [$injector:unpr] Unknown provider: USER_ROLES Then I tried adding USER_ROLES followed by webapp-client.USER_ROLES into webapp-home's dependencies when I declared the module but those just produced similar errors: quote:Error: [$injector:nomod] Module 'USER_ROLES' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument. I thought it would be as easy as passing in dependencies into a Controller but it turns out it isn't quite so simple. What am I doing wrong?
|
# ¿ May 6, 2015 17:36 |
|
Silvah posted:The problem is you're trying to access a link-time constant at compile-time (the config method happens before linking). What you're looking for instead of data is "resolve": https://github.com/angular-ui/ui-router/wiki#resolve On a related note, is there a better way of including authenticated/authorization checks than to include this block of code at the top of every controller? code:
IAmKale fucked around with this message at 01:02 on May 11, 2015 |
# ¿ May 10, 2015 19:37 |
|
Silvah posted:If you want to avoid putting that block in every controller, you're probably better off overall just using strings and the data declarations in your states, rather than trying to inject the USER_ROLES constants at link-time. Now I have a Bootstrap problem. I'm creating a user portal that will hide some options based on the user's current role. I'm using this basic layout right now to present two options per row, up to however many options might be made available in the future: code:
|
# ¿ May 11, 2015 22:25 |
|
I have two ng-repeats, one nested inside the other. How can I get the parent ng-repeat's $index from within the child ng-repeat?code:
|
# ¿ May 14, 2015 19:59 |
|
gmq posted:I can't test right now but I think $parent.index would give you the index you want. Edit: I found this SO post that explains a couple of different ways to handle this: http://stackoverflow.com/questions/14807258/access-index-of-the-parent-ng-repeat-from-child-ng-repeat. The cleanest looks to be defining a variable for the key in the parent ng-repeat for ease-of-access in descendant ng-repeats. IAmKale fucked around with this message at 20:59 on May 14, 2015 |
# ¿ May 14, 2015 20:16 |
|
What are some good services for sending notifications to users via email or SMS? Everything seems to be focused on sending out mobile device notifications but I need something a bit more traditional for this web app I'm working on. Amazon has its "SNS" service but I've just started reading the API docs and so I'm not yet sure if it's a feasible solution.
|
# ¿ Jun 10, 2015 06:01 |
|
Moment.js is tripping me out with some functionality that runs counter to my experiences with Objects in Javascript. When I grab a duration and output it to the console:code:
But when I try to access, say, duration.data.hours Chrome spits out an error, "TypeError: Cannot read property 'data' of undefined". Of course, this is not the proper way to access hours according to the Moment docs - I'm supposed to retrieve it with duration.hours() (and indeed that does work). It's weird, though, that I still get back what looks like a regular object when I write it to the console. And yet I can't access any of its parameters as with other "typical" (?) Objects. What's going on here? How did they accomplish this?
|
# ¿ Jun 18, 2015 17:43 |
|
butt dickus posted:It's a private object property.
|
# ¿ Jun 18, 2015 18:34 |
|
Munkeymon posted:You want to read https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty Now I've another question, this one related to Angular. Let's say I'm iterating through items and displaying the total number of hours of those items as such: code:
And I just realized that the filter will probably complicate things. I thought about calculating the total hours via ng-init but that won't update the value as items are added to or removed from ctrl.items...
|
# ¿ Jun 18, 2015 23:59 |
|
I just figured out AWS' SES service for sending out e-mails via SMTP in Python, so now I need to figure out how to expose this new "send an e-mail" functionality to the clientside of things in a REST-oriented way. Right now I'm thinking about making an endpoint, something like /v1/api/admins/send_notification/<template ID>. The idea is, there are three different types of notices to send out, and the client just needs to specify which notice (template) to use. Provided the POST call passes authentication and authorization, the server would then handle preparing and sending out e-mails based on the specified template as it's defined on the server. Afterwards it'll probably return the number of e-mails sent, or some other kind of object of success:failure messages indicating that SOMETHING happened. Is there a better way of going about this?
|
# ¿ Jul 1, 2015 20:27 |
|
I'm having the most bizarre issue with an Angular ngRepeat. I have four records stored in a database that I retrieve via a REST call and then process in JavaScript. The resulting object looks like this:JavaScript code:
code:
When I run the code locally, this is the (correct) order that's displayed: But when I upload and run the code on Heroku the order is completely bonkers: I tried explicitly sorting by id but that didn't help: code:
So what the hell is going on? I just started running into this problem and some console logging confirms that the order of the object is exactly the same regardless of whether it's output locally or when hosted online. It's just the ng-repeat that fucks up the order.
|
# ¿ Jul 18, 2015 02:12 |
|
bartkusa posted:Object keys don't have an order.
|
# ¿ Jul 18, 2015 03:43 |
|
EmmyOk posted:Checking if they have unlocked a lesson is simple I am just not sure if hiding list elements can be done in PHP. Edit: You mentioned you can already check for which lessons have been unlocked. IAmKale fucked around with this message at 22:32 on Jul 20, 2015 |
# ¿ Jul 20, 2015 22:27 |
|
EmmyOk posted:The way they have it laid out is just a list of links on the homepage. 1. Use JQuery to GET from the server the user's list of unlocked lessons 2. Edit the above HTML file and assign an ID to each lesson <a> element that corresponds with the lesson ID you track unlocked lessons by 3. Use JQuery to grab each <a> element and hide it if its ID is not in the list of ID's returned in Step 1 Since there's no server-side rendering going on then you'll need to grab the info from the server and do all the hiding on the front-end. It's not nearly as clean and you're getting into REST authentication but maybe you already have that stuff in place.
|
# ¿ Jul 20, 2015 22:47 |
|
EmmyOk posted:They've used bootstrap! By the server in part 1 do you just mean the database? For simplicty's sake, look into getting access to the FTP server and turning that one file you're working on into a PHP file. Then, perform your logic in PHP and then return an HTML page that only displays the user's accessible lesson <a> elements (querying the database for completed lessons is MUCH easier from the server side of things). This'll be a great introduction to serverside-rendering if you're not already comfortable with it.
|
# ¿ Jul 20, 2015 23:44 |
|
Fluue posted:The reason I ask is because I don't want to setup conditional authentication for mobile/desktop platforms. I'm having trouble wrapping my head around any way to use tokens without duplicating a lot of code/routes. Setting something like this up in your Angular's app.js helps immensely with simplifying calls to APIs that use token auth: code:
IAmKale fucked around with this message at 19:26 on Jul 23, 2015 |
# ¿ Jul 23, 2015 19:24 |
|
|
# ¿ May 17, 2024 20:56 |
|
Hey, are any of you guys dabbling/working in Polymer? I'm just starting out and I'm having a hell of a time getting app-router and more-routing working with 1.0. I want to use something more declarative to define routes but no mater what I tried I just couldn't get either of those to A) display the default path on initial load, or B) actually load a route when I clicked on a link. I'm very aware of the fact that I'm probably doing something wrong and I plan on starting over with a blank HTML document (I tried modifying the default index.html provided in the Polymer Starter Kit). I'm asking around to make sure there aren't some known issues that I'm fighting against and should just go with Page.js until the other two get sorted out.
|
# ¿ Jul 24, 2015 16:42 |