|
ddiddles posted:Are you writing ES6? I dunno, am I? I only say it that way because I'm just following the linked tutorial I see ` in app.js code:
If the back-tick is what it is complaining about, why did webpack --watch work but npm run build not work? Also, more rhetorical: Why would the tutorial be written in such a way that it won't work even if you follow it? I'm sorry I ranted earlier (again) I feel "old", like everything is moving too fast and I can't catch up.
|
# ¿ Feb 3, 2017 22:22 |
|
|
# ¿ May 22, 2024 16:45 |
|
What do you guys recommend for Angular R&D? I've still super green on it and trying to find an answer for my question* I either get: Something Unrelated The Answer in AngularJS The Answer in a pre-release of Angular 2 that no longer works. *The question is, how do I make a <select> where the values and text are just integers. From 1 to X (X i suppose could be hardcoded at 10, but ideally object.max if object.max < 10 (otherwise 10) )
|
# ¿ Feb 16, 2017 15:57 |
|
HaB posted:What version of Angular are you looking for? 2? Angular doesn't care what types your values/text are. You can use ng-options or even ng-repeat to do it. I'm looking for version 2. Aren't ng-options and ng-repeat AngularJS 1.X things? I see them done with: code:
|
# ¿ Feb 16, 2017 16:34 |
|
dupersaurus posted:If you already have a list of numbers, then the "object" there is a red herring, it's just iterating over a list. In JS syntax *ngFor is a for...of statement. If you're looking to emulate for (var i = 0; i < x; i++), then yeah you'll have to generate a list and iterate over it. Thanks yeah, I came to the realization that I'm used to doing what you mentioned, but I have to generate that thing elsewhere then use it. EDIT: What about my original question of reseourches for R&D (and documentation) I know the angular docs, but not sure how to 'phrase' a question so I'd find it there.
|
# ¿ Feb 16, 2017 17:19 |
|
So I'm slowly, slowly learning Angular (2.X). I'm iterating over some objects: <div *ngFor="let basketitem of basketitems" class="row itemInfo"> but I'd like to sort, and group, by a property. I know sortBy and groupBy were removed from AngularJS because reasons. I wouldn't know where to start to write my own, but I found angular2-pipes. Trouble is, I don't think I installed it properly. I went to the folder that contains /app and /node_modules and did npm install ngx-pipes --save, I see it in package.json. Then in app.module.ts I put import {NgPipesModule} from 'ngx-pipes'; and NgPipesModule in the imports array in @NgModule, but when I try to use it, even by copy/pasting the first example in the docs, it gives an error saying it can't find the pipe. Since I just started learning Angular this is the first plugin I've tried and I know with previous issues I've had with Angular it was just from not importing dependencies properly.
|
# ¿ Mar 14, 2017 15:34 |
|
Plavski posted:Is your version of TypeScript up to date? Do you have definition files for that module? I'm not quite sure how to answer those questions My package.json says "dependencies": { "ngx-pipes": "^1.4.6", } and "devDependencies": { "typescript": "~2.0.10",}. I see an /ngx-pipes folder in node_modules and I started this project using Angular Quickstart
|
# ¿ Mar 14, 2017 15:53 |
|
Skandranon posted:I'd say they were removed for a good reason... Specifically in Angular 1.x, filtering in the template was 2x as expensive, as it happened during digests and thus, happened at least twice. But from a code maintenance perspective, Angular 1.x tried putting too much logic in the HTML. I'd put your sorting and grouping logic in the controller, and have your template iterate over that, it'll make it a lot easier to tweak later on. I understand the reasoning, but given how new I am to Angular I'm having trouble actually doing it
|
# ¿ Mar 14, 2017 17:13 |
|
Skandranon posted:Put a get property on your controller like so When I try what you suggest: code:
|
# ¿ Mar 14, 2017 18:09 |
|
Skandranon posted:Sorry... I was being a bit brief, filter().sort().group() aren't real functions... I guess it would look more like this.basketitems.filter(b => b.thingIWant).sort((a,b) => a.sortField > b.sortField). Probably some good grouping methods in lodash. Oh I see, just pass the original array and output another? Well I got sorting working, but that grouping. I can't wait until I'm done to share my findings because it seems I'm the first person in the world to want to do something in Angular that was built-in to AngularJS. EDIT: Looks like I can pause this anyway since upon doing so, I realized a bunch of possibilities that we don't have requirements for. The Merkinman fucked around with this message at 21:17 on Mar 14, 2017 |
# ¿ Mar 14, 2017 20:09 |
|
Why are you talking about Angular 2? It's 4 now. Also I think it's great that Angular, written by Google, has terrible SEO.
|
# ¿ Apr 1, 2017 14:40 |
|
The issue comes from (I believe).. iPhone came out, and supported the whole web (well sans-flash) and since a lot of UI depended on :hover, they treated :focus like :hover. I believe Android did the same thing, but as websites started getting designed for touch, Android went the expected behavior of :focus being :focus. Apple has yet to update iOS Webkit to the expected behavior and maybe never will for fear of 'breaking the Internet' like when IE finally went more in line with standards.
|
# ¿ Apr 6, 2017 14:07 |
|
We've started transitioning to using Docker. Because of that, and the fact that I do my development on Windows 10 (to reflect the environment our average non-mobile customer uses), I can no longer use VirtualBox to test other versions of IE, preview versions of Windows 10 and also Linux just because I use it at home. I looked up some thing about Docker Toolbox but don't know if that's even what I'd want for my use case. I also tried Microsoft's Hyper-V, but I get an error Failed to create a new virtual machine, even when using their image! I'm sure other people in here have a combo of Windows+Docker+need to test other OSs, right?? What do you recommend? (don't say just use Linux/Mac as I then wouldn't be using what our average customer does!)
|
# ¿ Apr 26, 2017 13:59 |
|
The Fool posted:I just use Hyper-V. Do you have local admin? I think so, I even tried running Hyper-V as admin. No Dice. EDIT: OK if I use the normal "New" option instead of "Quick Create" I'm able to make one....but it doesn't have any internet access. The Merkinman fucked around with this message at 13:54 on Apr 27, 2017 |
# ¿ Apr 26, 2017 22:33 |
|
Some people here wanted to use AMP because of buzzword, when I told them it meant they couldn't have all the custom JavaScript we have/"need" on our product pages, they backed off. I could very much see it for a very read-only/article based website though. Since there is some downtime in my main project, I'm getting back into Webpack. I'm going through the Guides and was starting to pick it up until I tried Cleaning the /dist folder. That whole page is poor, look at the supposed diffs throughout that page alone, they're clearly missing stuff.* As such, I'm sure I'm missing stuff so webpack won't compile now. index.js code:
code:
Suddenly, under "Setting up HtmlWebpackPlugin", webpack.config has vendor: ['lodash'] Later, under "Cleaning up the /dist folder", HtmlWebpackPlugin has two more properties of filename and template
|
# ¿ Jul 13, 2017 18:24 |
|
Munkeymon posted:The http://stateofjs.com/ survey is open again if you want to join me in expressing mild disdain about parts of the ecosystem
|
# ¿ Jul 19, 2017 16:07 |
|
Lumpy posted:Just when I was about to try {{framework version+1}} for the first time!!! Or should I just wait 5minutes for Webpack 4/ Some other-totally-better-than-Webpack.js to come out?
|
# ¿ Jul 24, 2017 20:31 |
|
So the fact that the documentation tutorial on Webpack's site is broken is fine because I shouldn't use Webpack anyway
|
# ¿ Jul 25, 2017 13:33 |
|
Has anyone read this article comparing Angular, React, and Vue? For those familiar with those frameworks, what are your thoughts? https://medium.com/unicorn-supplies/angular-vs-react-vs-vue-a-2017-comparison-c5c52d620176
|
# ¿ Sep 21, 2017 01:23 |
|
Every time I read this thread, I feel dumb for officially/unofficially deciding on Angular where I work.
|
# ¿ Sep 24, 2017 15:59 |
|
Munkeymon posted:Also there's only one browser window size: the default size of a new image in Photoshop. and the only device people use is a 27" Retina iMac
|
# ¿ Oct 4, 2017 19:12 |
|
geeves posted:I would add https://plainjs.com/ for people who have been overly-reliant on jQuery. http://youmightnotneedjquery.com/ to help people transition.
|
# ¿ Oct 22, 2017 04:46 |
|
Nolgthorn posted:I would like to see documentation by the World Wide Web Consortium, which is where language features and standards come from. And I want browser makers like those companies you mentioned to implement those standards properly. The thing is, often times browser vendors make their browser work with a feature before that feature is 100% finalized by the W3C. This is because the W3C often takes way too long to finalize a standard and how we got the WHATWG.
|
# ¿ Oct 22, 2017 14:57 |
|
Grump posted:yeah. This is an app that will potentially be installed on 100s of eCommerce stores, so probably not the best that I'm emitting source maps. Just the thing for Cyber Monday!
|
# ¿ Nov 27, 2017 18:43 |
|
Is it bad to use Angular (or I guess React or Vue) to make an entire site an SPA? By entire site, I mean entire e-commerce site with dozens of different pages. Is it better to make each type of page (product listing, product, checkout) its own SPA instead?
|
# ¿ Nov 28, 2017 16:31 |
|
Nolgthorn posted:I'm at a weird time in my life where I cannot decide between having lots of spinners for all the different things that load everywhere. Or whether there should be one single spinner somewhere always at the same place on the page. Then just have a value that counts up and down the number of different things that are loading to decide whether the spinner should be spinning.
|
# ¿ Dec 5, 2017 15:58 |
|
It's me, I'm the idiot using Angular
|
# ¿ Dec 8, 2017 02:08 |
|
prom candy posted:Edit: Follow up question for the thread: what tools do you use to collaborate with your designers? Do they write any code? How do you get them thinking in a component/interactive mindset if they design using tools like Sketch? They don't write code, with the exception of modifying CSS via Stylus. That helps them play around with global changes before even giving it to us in Dev. Getting into the component mindset I think was largely from a push from the UX team here. Start with basic things like h1 then up to button, eventually going to custom elements. Maybe letting them know it'll be more consistent from a brand standpoint will help? Has there been any particular pushback? Sketch has "libraries" so it is possible to do components in Sketch.
|
# ¿ Dec 8, 2017 14:50 |
|
Pollyanna posted:The designer/product owner I work with - same person - uses Zeplin and sometimes gives me Sketch files, but doesn't give me any actual hard numbers - she expects me to extrapolate it from the designs themselves, and then comes back with a list of (tweaks i.e. pixels and font sizes) to be made after I put the PR up (or the equivalent of a PR in our case). Tickets inevitably take longer to complete as a result The designer/product owner being the same person seems like its own issue...
|
# ¿ Dec 8, 2017 15:58 |
|
2017 State of JS came out.
|
# ¿ Dec 13, 2017 14:41 |
|
I'm going to revamp our service worker with Workbox. I've got it up and running, changed the workbox-cli-config.js so it's generating the file, it's also running properly. Looking at the features of the API, what exactly is precache? How is that different than any of the strategies?
|
# ¿ Dec 27, 2017 15:56 |
|
EVIL Gibson posted:Yep. This is my issue but it's just like someone listed a Defcon video and I understood everything he was talking about because I've seen and taken advantage of similar bugs to get into systems. (framebusting, hijack, etc). Different strokes for different folks. What are you looking to make? A single page webapp that does one thing? A small multiple page site, a large one? While a lot of the things thrown around are subjective, knowing what you intend to build is a start.
|
# ¿ Dec 30, 2017 22:57 |
|
Questions about Webpack and making a vendor bundle with CommonsChunkPlugin (if that's even what I should use). If I'm specifying what files go into the bundle, then what is the CommonsChunkPlugin even doing? Also would I need to still put import $ from jquery at the top of my .js files, or is just having the external reference to vendor.js in the HTML enough? Source: Webpack Documenation code:
|
# ¿ Jan 22, 2018 14:43 |
|
Lumpy posted:The CommonsChunkPlugin can do a few things, which is unfortunate, because it makes it confusing. One use of it is to automatically ensure that common code is in the "main" file if you are creating several small bundles to be served async to users as they use your app. So if they have to load 'home.js', 'about.js', and 'fart.js' as they hit those routes in your app, then any code that is in more than one will be moved "up" into the parent bundle for you instead of bloating three bundles. That is not your use case though! OK so actually my specific use case is more like code:
Would jquery just be the jquery.min.js I get from their site ( but locally hosted), or would it be the npm package? What's the use case in one vs the other?
|
# ¿ Jan 22, 2018 16:27 |
|
Lumpy posted:Correct. You'll still need to import in your code wherever you use those libraries, and Webpack will make sure that the page*.js bundles know about where they live in vendor.js Lumpy posted:The CommonsChunkPlugin can do a few things, which is unfortunate, because it makes it confusing. EDIT: I'd like for us to stop using jQuery too. Having import $ from 'jquery' in the file itself is a good way to tell the developer "hey you should probably refactor this file to not need jQuery". The Merkinman fucked around with this message at 17:55 on Jan 22, 2018 |
# ¿ Jan 22, 2018 17:21 |
|
Knifegrab posted:What is the most modern and best solution to have two divs that are side by side, switch to being above/below one another depending on size of browser (responsive) It's the most modern, but really any other suggestion would depend on what is sizing the divs, and when you want them to stack.
|
# ¿ Jan 26, 2018 20:57 |
|
Lumpy posted:Counterpoint: Flexbox. Better support, and probably easier to implement. Webpack 3 question. So I'm having to rewrite some js with stuff like imports and defining variables so it compiles. This is fine and I'm trying to do it bit by bit. This is basically my code, but I've changed the names of the files. code:
Also, Webpack 4 beta, with no CommonsChunkPlugin
|
# ¿ Jan 29, 2018 15:53 |
|
darthbob88 posted:Angular question: My app is refusing to bootstrap because it can't resolve the parameters for my component. So far as I can tell, everything should be resolvable; the services it relies on are all properly typed and decorated with @Injectable(). What else should I look for to troubleshoot this? None of my googling has found a solid answer. What specifically is the error? Do you have a component with an @Input that you're not giving a value in the parent?
|
# ¿ Apr 26, 2018 03:49 |
|
Has anyone successfully tried the new Custom Elements in Angular 6? Anything I find either has bad documentation or doesn't work
|
# ¿ May 15, 2018 20:32 |
|
Anyone here have experience reading/writing URL parameters with Angular 6? I tried following some Googling but then I just end up with code:
code:
code:
|
# ¿ Jun 8, 2018 19:50 |
|
|
# ¿ May 22, 2024 16:45 |
|
LOOK I AM A TURTLE posted:You need to add RouterModule to your imports. Adding ActivatedRoute to providers won't do much on its own because it depends on a bunch of other services, which is what the question marks are telling you about. Those error message could really be better. hmm I updated my app.module.ts to have: code:
code:
|
# ¿ Jun 11, 2018 14:45 |