Answer the question
In order to leave comments, you need to log in
How does server work work when using Angularjs?
When using Angularjs, the application consists of three main parts, the Model View and the Controller. The model displays the data, and the controller displays all the application logic. The controller is written in a js file that is executed in the browser and, if necessary, requests data from the server. It turns out that the entire site engine works for the client. Did I understand it correctly? But what about the server part of the application written in php or java? How is data exchanged between the application and the database?
Answer the question
In order to leave comments, you need to log in
No way, you allocate static memory for 1000 elements of type "x". If you use third-party libraries, it only gives the appearance that such an operation is done in 1 line. To then move subsequent elements back, you need to iterate the entire array. To make it 1 less, you need to allocate a new memory instance for this array and copy the old elements into it.
Choosing a data structure - think before you have to work with it, if you need it in a dynamic version, then it's better to use vector.
std::vector<int> array;
array.erase(array.begin() + 400);
int a[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
auto iterToRemove = std::next(a, 4);
std::copy(std::next(iterToRemove), std::end(a), iterToRemove);
memcpy will "shift". There is also a cycle, but "inside".
You, judging by the question, do not understand how an array works - it's just a memory area.
You can delete an element in a std::vector.
For example:
std::vector myarr;
myarr.push_back(0);
myarr.push_back(1);
myarr.push_back(2);
myarr.push_back(3);
myarr.push_back(4);
myarr.erase(myarr.begin()+2);
for(int n : myarr)
{
printf("%d\n",n);
}
0
1
3
4
Through Ajax. Angular 1 has a wrapper over it - $http vervis
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question