PHP

Support group for those afflicted with PHP. Don't ask to ask, ...
Feb 8, 2019 09:18
0
Q: Make Laravel 5 and Angular 5 work on the same domain/port

SteamFireI want to avoid cors so I would like to make Laravel serve my Angular frontend. My backend already works like an API but for security and simplicity, I would like to merge the two parts. Is there a good way to implement it as you can do with Vue.js? Did someone already did that? I already made ...

Feb 8, 2019 09:08
Hello, does someone master laravel? :P
 

JavaScript

Topic: Anything JavaScript, ECMAScript including Node, React, ...
Apr 10, 2017 15:27
Hello, here is a nice place to talk about Angular 2: https://dystroy.org/miaou/2199
create an account and join us to share your knowledge and ask questions
Apr 10, 2017 14:09
the provider:
import {Patient} from "./patient.model";
export class PatientProvider{
private _setOfPatients: Patient[];

constructor() {
}

get setOfPatients(): Patient[] {
return this._setOfPatients;
}

set setOfPatients(value: Patient[]) {
this._setOfPatients = value;
}
}

Constructor of first component (provider is defined in providers):

constructor(router: Router, public patientProvider: PatientProvider) {
this.data=[];
this.range(50); //fill data
patientProvider.setOfPatients = this.data;
Apr 10, 2017 13:58
I'm using angular 2 providers, I set a value of this provider in one component and I try to use it in an other one but in seems undefined
(I use getter and setters in my provider)
Apr 10, 2017 13:56
Hellow
Mar 30, 2017 13:55
@BenFortune do you have any other non-sarcastic ideas? :P
Mar 30, 2017 13:45
yeah yeah but it already exists, don't want to recode the world
Mar 30, 2017 13:44
actually I'm using ng2-table but having some trouble with...
Mar 30, 2017 13:43
Filtering, sorting, paging, showing dates in different formatting...
Mar 30, 2017 13:41
can you filter objects with this one?
Mar 30, 2017 13:41
@BenFortune don't find this exact name
Mar 30, 2017 13:40
@KarelG haha
Mar 30, 2017 13:28
Non-objective question:
What library do you prefer to manage tables in angular 2? Why?
Mar 30, 2017 13:20
edit: you never left
Mar 30, 2017 13:19
after all those years
Mar 30, 2017 13:19
@rlemon!
Mar 30, 2017 13:17
hello again
Mar 30, 2017 11:28
you're right
Mar 30, 2017 11:25
@ErroreFatale I think you're not in the right channel
Mar 30, 2017 09:03
combo
Mar 30, 2017 08:39
no, that's overkill
Mar 30, 2017 08:39
huhu
Mar 30, 2017 08:39
angular 2
Mar 30, 2017 07:33
    PatientsPage.prototype.onChangeTable = function (config, page) {
        //if ( config != null ){
        if (page === void 0) { page = { page: this.page, itemsPerPage: this.itemsPerPage }; }
        if (config.filtering != null) {
            Object.assign(this.patientConfig.filtering, config.filtering);
        }

this is the compiled code
Mar 30, 2017 07:32
and then, when I'm performing action that use this function, it seems erased, it's maybe not a compilation problem.
Mar 30, 2017 07:31
there the object exist
Mar 30, 2017 07:31
Mmmm, it first run this function at initialising
Mar 30, 2017 07:22
problem is that I use a little library for tables in angular2 and the config object is passed to it lather
Mar 30, 2017 07:21
i'm using Object.assign()
Mar 30, 2017 07:20
oh, or as an Object
Mar 30, 2017 07:19
it's snippet
Mar 30, 2017 07:19
but I could declare it as an object or make an interface
Mar 30, 2017 07:19
it's not useful there
Mar 30, 2017 07:18
checking it
Mar 30, 2017 07:18
yeah
Mar 30, 2017 07:16
    public onChangeTable(config:any, page:any = {page: this.page, itemsPerPage: this.itemsPerPage}):any {
            //if ( config != null ){


                if (config.filtering != null) {
                    Object.assign(this.patientConfig.filtering, config.filtering);
                }
[...]
}
Mar 30, 2017 07:16
having trouble with caprica
Mar 30, 2017 07:15
when I console.log it, it is also defined
Mar 30, 2017 07:13
better indentation...
Mar 30, 2017 07:13
public patientConfig:any = {
    paging:true,
    sorting: { columns: this.patientColumns},
    filtering: {filterString: ''},
    className: ['table-striped', 'table-bordered']
};



public ngOnInit():void {
    console.log(this.patientConfig);
    if (this.patientConfig != null) this.onChangeTable(this.patientConfig); //I pass my object there
}
Mar 30, 2017 07:12
hahahaha
Mar 30, 2017 07:12
oh
Mar 30, 2017 07:11
oh caprica, I missed you
Mar 30, 2017 07:10
yup
Mar 30, 2017 07:07
I'm running my server in server:dev:hmr
Mar 30, 2017 07:06
but when I do it with the compiled code, it is undefined
Mar 30, 2017 07:06
An object that I'm giving to a function is undefined but if I follow my code step by step in TS, it doesn't seem so, when I watch this object it seems well declared
 

Trash can

Like the recycle bin, but trashier.
Mar 30, 2017 07:16
public onChangeTable(config:any, page:any = {page: this.page, itemsPerPage: this.itemsPerPage}):any {
        //if ( config != null ){


            if (config.filtering != null) {
                Object.assign(this.patientConfig.filtering, config.filtering);
            }
[...]
Mar 30, 2017 07:10
public patientConfig:any = {
paging:true,
sorting: { columns: this.patientColumns},
filtering: {filterString: ''},
className: ['table-striped', 'table-bordered']
};



public ngOnInit():void {
console.log(this.patientConfig);
if (this.patientConfig != null) this.onChangeTable(this.patientConfig); //I pass my object there
}