« first day (297 days earlier)      last day (1041 days later) » 

09:25
Morning everyone!
helloah
Hey falcon
How u doing?
Gd. you?
Great. Just working on some simple design stuff
 
1 hour later…
10:48
Hi all
hey Alex
Hey Alex
11:28
Hey guys
What the deuce
Anyone worked with Angular?
12:26
@Alex maybe?
Never worked with it, sorry
12:44
Falcon, I tried adding it to a large MVC app. Realized it would require weeks/months of refactoring. Abandoned it
holy fuck
I got myself into a bloody messed up Angular MVC project
Vue is a better choice for existing MVC apps
Feel like the coder of this shit used 5 bottle of vodka before starting
Is it AngularJS or Angular 2+?
Why do I have a folder called "App" with tons of folders/files?
No idea. where can I see that lulz
I'm totally new to Angular #RIP
12:48
Those are your client side files. One folder is node_modules
yes
That stuff is used for build time stuff
I have that folder as well
that's angular2 right?
I'm thinking this is a later version of Angular
so I have 2 hours to learn this as I have a deadline on thursday.
12:49
If they had it as part of the app from the start then it's better
I love it when freelancer developers suddenly 'got sick'
Trying to add it later is a nightmare/not possible
He implemented Angular from the start
it's just a project that I haven't seen yet
Yeah, that's how it should be done
he has been working for a year.
now I need to add functionalities
But the C# Controllers are empty lol
12:50
Angular (ng) is a great skillset to have
how does this even works
It probably uses web api to do the server calls
the fk
got all those 'let url = 'api/freightelement/GetElements' + "?orderNr=" + orderNr;'
What is that api?
That's web api
you should have some controllers soomewhere that have freightelement defined as a base rought and a GetElements route within that controllers
12:52
Look for that first string in the project
Search for this: api/freightelement/GetElements
It'll be a route on a controller
^ that string might not be defined in the controller if it has a base route of only api/freightelement
as a single string
True
can only find that thing I linke
Also what do they mean with 'api'
where is it defined?
cant even find his html lols
It's essentially just a controller that doesn't return a view, only data. You generally hae a Controllers/Api/ folder that contains things like FreightElementController.cs
Yup, that ^
As for the views, he's used ng for the templates
12:59
but ehm.. I have no Controllers/Api
Or is it inside the App folder?
oh the html files are inside app/components
I see some ng stuff indeed. no idea what it is though
It's possible that the api isn't in your project at all. For the url provided, do you see any "base" urls nearby? Whatever goes in front of ___/api/freightelement/GetElements
Sometimes people split Api's from the front-ends for scalability reasons
private apiUrl = 'api/freight';
Nope
let url = this.apiUrl + '/get' + "?orderNr=" + orderNr + "&daysToDisplay=" + daysToDisplay + "&startDay=" + startDay;
weird right?
where is this.apiUrl defined?
13:17
private apiUrl = 'api/freight';this?
freight.serivce.ts inside the App
app\services\freight.service.ts
13:39
well somewhere something needs to be defined that is either a localhost or an freightApi.com. Can you run the app with dev tools open and see where the data is actually coming from?
I can see it executes sql procs somewhere
Angular >.>
Ok I give up
I change a html file and nothing happens
14:14
It's possible that file is cached, or simply not the file you think it is. Angular can be very trickey
14:27
Cached should be fixed with ctr+shift+r
14:37
This project:
hi there
I have a webapi controller and a razor view which somehow I fail to connect
I mean in the layout file where I add the new menu item I typed the name to be displayed the name of the view and controller
but when I build this page can't be found
WebApi controllers shouldn't have views
14:54
why @dckuehn
????
15:16
web api controllers return data only, meaning any Razor view will only be a placeholder. The real work is done in JS to build a view with that data
So in reality, there's no point in having a cshtml.
You use Angular/Vue to then load the data into some template
Or plain JS
@alex that said I can tell you that in my view i have a reference to a knockout page so what you just said is exactly what I did
the only thing I want to ask you is if I need a fake controller to start the webapi controller
otherwise how can I link the needed page in the menu in layout.cshtml???????????
<li>@Html.ActionLink("Home", "Index", "Home", new { area = "" }, null)</li>
 <li>@Html.ActionLink("Book", "Book", "Books", new { area = "" }, null)</li>
the second menu item which is book it can't be found
where Book is the displayed name Book is view page name and Books is the controller name which you said earlier that shouldn't be used
15:33
uhhh
Razor doesnt work with Angular?
I'm using knockout
oh ngif
what the heck *
@Riccardo you should have two sets of controllers, normal MVC controllers to return a view (even if it just embeds a single-page javascript app) and a set of WebAPI controllers that your javascript will make calls to to retreive data
@dckuehn I already have this stuff all I miss is a menu
I mean I'm in the home section and want to go to bookshop section how do I navigate using the menu?
in essence based on the above code what is the wrong section???
<li>@Html.ActionLink("Home", "Index", "Home", new { area = "" }, null)</li>
<li>@Html.ActionLink("Book", "Book", "Books", new { area = "" }, null)</li>
the second <li> is not found when I click it in the homepage
@dckuehn
Do you have a controller named BooksController?
15:43
yeah but it's a webapi controller
which you said shouldn't be linked to any view
and the book view references a js page
Yeah, change the base class it's inhering to just "Controller"
I don't want to do that I need a webapi controller
and maybe I found the problem
in home controller I just have a reference to index.cshtml
maybe all I need is to add the reference to book controller and return the book view
am I right?
public ActionResult Book()
{
return View();
}
Why do you need a WebApi controller?
because I'm building a MVC WebAPI application
I perform get post put and delete requests so that's why I need a webapi controller
just tell me if that code is right or wrong
Dude I can't just tell you that. I don't think your code is organzied the right way. I agree that you need a WebApi controller but it shouldn't be returning a View();
15:50
in fact it doesn't not
I'm following an online tutorial and I misunderstood that section
I use a js client where I define a view model and ajax helpers to perform REST http requests
after that I have a webapi controller and some model classes
so what you said earlier is right a WebApi controller shouldn't be returning a View
all I want to do is to edit the home controller and add a reference to my view page
and in _layout.cshtml change the controller reference from the webapi to home controller
am I right based upon what you just said?
I think so
great
let you know if it works
I'm still waiting it's compiling and it's been taking quite some time now
it's a bit slow
16:12
@Riccardo You may need a regualr (MVC) controller/action to launch the initial page
yeah that's why I did
Been dealing w/ this headache: stackoverflow.com/questions/2355947/…
This turned out to be the answer: stackoverflow.com/a/15154623/177416
Very strange
17:16
Hi guys
I need to: Sort list of candidates for a job by wanted_sallary (asc), at the end add candidates without wanted_sallary (null), if you have more then one candidate for a job with the same wanted_sallary, priority have earlier applications (date_of_application), throw away all candidates without 3 years of experience (by method)

Do i need to make some sorting method for this or I can use someone?
some*
17:36
Should be able to do something like candidates.OrderBy(x => x.SalaryWanted).ThenBy(x => x.ApplicationDate).ToList();
hmm thank you @dckuehn
i'll try
but if I want to use some of the sorting algorithms, which one should I choose?
18:29
@dckuehn
yeah code work but null values is first, i need them to last :D
ThenByDescending?
Ascending but null last :)
Can you add a default value insetad of null?
hmm no
so i need to make my algorithm? :D
18:42
i found the solution
94
Q: LINQ order by null column where order is ascending and nulls should be last

sf.I'm trying to sort a list of products by their price. The result set needs to list products by price from low to high by the column LowestPrice. However, this column is nullable. I can sort the list in descending order like so: var products = from p in _context.Products where p.ProductTyp...


« first day (297 days earlier)      last day (1041 days later) »