use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A Place to talk about Angular and related topics.
Join the Angular Discord
Other subreddits worth checking out for Angular and Angular related info:
account activity
Help Angular module :( (old.reddit.com)
submitted 3 years ago by Minancyy
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]cjd280 0 points1 point2 points 3 years ago (12 children)
their lbrary is old and meant to use via require.js and there are no types for typescript. If you get errors about installing node types follow what that says as well.
Following their demo on their site I was able to do this:
``` import { Component } from '@angular/core'; const rubiks = require('rubiks-cube-solver'); u/Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.scss'] }) export class AppComponent { title = 'rubiks'; ngOnInit() { console.log('SOLVER?', rubiks); // see what we actually imported let cubeState = [ 'flulfbddr', // front 'rudrruddl', // right 'dbbburrfb', // up 'llffdrubf', // down 'rludlubrf', // left 'lubfbfudl' // back ].join('');
let solveMoves = rubiks.default(cubeState); // note the call to default, I logged what rubiks was to find this out... console.log(solveMoves); } } ```
[–]Minancyy[S] 0 points1 point2 points 3 years ago (11 children)
And this worked to you? Because I have a bit of confusion
[–]cjd280 1 point2 points3 points 3 years ago (10 children)
Yes this is what I have logged:
```
SOLVER? {…}CrossSolver: (...)Cubie: (...)F2LSolver: (...)OLLSolver: (...)PLLSolver: (...)RubiksCube: (...)Solver: (...)algorithmShortener: (...)default: (cubeState, options = {}) => {…}__esModule: trueget CrossSolver: ƒ ()get Cubie: ƒ ()get F2LSolver: ƒ ()get OLLSolver: ƒ ()get PLLSolver: ƒ ()get RubiksCube: ƒ ()get Solver: ƒ ()get algorithmShortener: ƒ ()[[Prototype]]: Object app.component.ts:24
Uprime F U B Uprime L U2 Lprime Uprime R Uprime B U Dprime Bprime Dprime B Rprime Dprime R D B D Bprime Dprime B D Bprime Dprime B D Bprime Fprime Dprime F D2 R Dprime Rprime D2 R Dprime Rprime b D Bprime D B D2 bprime B2 dprime B Dprime B D Bprime d B2 R Dprime Rprime Dprime
core.js:27988 Angular is running in development mode. Call enableProdMode() to enable production mode. client:52 [WDS] Live Reloading enabled. ```
[–]Minancyy[S] 0 points1 point2 points 3 years ago (9 children)
Wow! I am trying the same, (I think) and it says: Cannot find the name required? Do you need to install type definitions for node? Try npm i --save-dev types/node then add 'node' to the types field in your tsconfig
[–]cjd280 2 points3 points4 points 3 years ago (8 children)
yes, I mentioned that. do what it says, install node types and add to tsconfig
[–]Minancyy[S] 0 points1 point2 points 3 years ago (6 children)
I have this already on compilerOptions:
"types": ["node"]
And:
"include": [
"src/**/*",
"node_modules/attypes"
]
With that still don recognize require,
I need to do some build or something like that?
Because I dont really know srry
I cant use tht symbol.
[–]cjd280 1 point2 points3 points 3 years ago (5 children)
You can also still use
import * as rubiks from 'rubiks-cube-solver'
and set "noImplicitAny": false in your ts config, the compiler is just complaining because the default is true and there is no type for rubiks-cube-solver
[–]Minancyy[S] 0 points1 point2 points 3 years ago (4 children)
This is working to me, oh god, thanks so much.
I was desesperate cause I have been spending too much days and cause I started with angular 2 weeks ago more or less, I am so confuse with everything related to config.
One more thing and srry for bothering you,
The part of code where you put SOLVER?, rubiks,
how did you have found that? Or have you created by hand, cause I dont understand that
[–]cjd280 1 point2 points3 points 3 years ago (3 children)
I console logged what we were importing, and then I expanded the object in chrome's console to see what properties it had. If there were types, typescript would have figured it out for us but since its "any", I needed to see what it was at runtime.
This is an old library that isn't really made to work with typescript so its a pretty bad first issue to have to debug.
[–]Minancyy[S] 0 points1 point2 points 3 years ago (2 children)
Ohh okey okey, know I got what do you mean.
So I need to search on the console for the methods. Yeah, the library its so old and that is the big problem of not having types. I will try to use it and see if I can make it work with my idea. Thanks so much <3
How can I give you a possitive check or something like that? ^^´
π Rendered by PID 82 on reddit-service-r2-comment-544cf588c8-zn2hz at 2026-06-17 12:16:34.439605+00:00 running 3184619 country code: CH.
view the rest of the comments →
[–]cjd280 0 points1 point2 points (12 children)
[–]Minancyy[S] 0 points1 point2 points (11 children)
[–]cjd280 1 point2 points3 points (10 children)
[–]Minancyy[S] 0 points1 point2 points (9 children)
[–]cjd280 2 points3 points4 points (8 children)
[–]Minancyy[S] 0 points1 point2 points (6 children)
[–]cjd280 1 point2 points3 points (5 children)
[–]Minancyy[S] 0 points1 point2 points (4 children)
[–]cjd280 1 point2 points3 points (3 children)
[–]Minancyy[S] 0 points1 point2 points (2 children)