Coder Social home page Coder Social logo

passing a url fetched from a service to a factory; factory use it to fetch additional data and pass it to a route about customermanager HOT 2 CLOSED

danwahlin avatar danwahlin commented on August 27, 2024
passing a url fetched from a service to a factory; factory use it to fetch additional data and pass it to a route

from customermanager.

Comments (2)

DanWahlin avatar DanWahlin commented on August 27, 2024

I'm not clear on exactly where you're running into problems unfortunately. I'm happy to help as much as I possibly can but need more specific info on exactly which file you're having problems in. Looks like you're off to a great start though.

from customermanager.

xdiscovery avatar xdiscovery commented on August 27, 2024

Ah ah, thank you for the encouragement :)
and thank you for your willing to help, really helpful indeed!!

I will try to be as clearer as possible.

Please locate the app of CustomerManagementApp.html

In customers.html I want to have a list of customers:
and View {{ customer.orders.length }} Orders
should route to the customer page /customerorders/#/id

I want that by clicking on the above hyperlink, /customerorders/#/id will load additional data related to that customer.
That means a $http request against an url property of a customer object.

I also want that customers.html will load customers objects with another $http request.

The scheme is (I guess):
1- customer.html fetches data of customers with customersService service, with a $http request
2- customer object contain an id and a url to a json file related to the customer
3- CustomerOrdersController get the customer ID from customersService AND pass the url to (I guess another) service: say additionalinfoFactory AND routes to the page /customerorders/#/id
4- customerOrders.html/#/id load data from additionalinfoFactory($http, customer.url) and display accordingly with a directive (additionalinfoDirective)

I am struggling with it and I am stucked.
I can't pass the customer.url from customersService to additionalinfoFactory, make additionalinfoFactory fetch the corresponding json data, pass the data to additionalinfoDirective.

Any help in doing this?
In the github link I posted I was trying to do this; in the example, additionalinfoFactory is named graphFactory and graphDirective, and then I named customers as maps, the rest the app is the same as yours.

If you could sketch out a working template with mock data, it would be great cause I would finally figure out what I have been doing wrong.
Thank you, really much!

from customermanager.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.