I was greatly encouraged to learn the official tutorial of Phonecat, but something went wrong when I tried to rebuild it.
1. Use the same version of angularJS and related components, and register in the same way as Phonecat. Dependencies define a series of component modules. (Every character is checked...)
2. The difference from the original version is that I gave up the js file with the spec keyword, because I learned that its function is for unit testing, so I was lazy and didn't do it.
Here comes the problem: When trying to traverse and read the data in the json file in the fake phone-list component, the official ng-repeat method is used, and it is not displayed on the view (the search box and other files on the same template everything), firebug shows that there is only one line in the middle of <ul></ul>
<!--ngRepeat: recipe in $ctrl.recipes | filter:$ctrl.query | orderBy:$ctrl.orderProp-->
Note: Firebug will display a line in the original demo: Phone.json: 1:1; error, which turns out to be harmless, and my counterfeit work will also display this line. Personally, I feel that this json is still read, that is I don’t know why the repeat is not coming out. There is less information on the Internet. It seems that someone said that json.parse operation is needed. I don’t understand it very well. Please be an experienced driver. Thank you for your patience in reading my nonsense here
Github has just uploaded: the recipe
Supplementary: Only the recipe-list part has been done. According to the spirit of the original version, this part should be able to run independently
The main_component contains all official components (angular.js etc.)
recipequery is the $http package I made after the official core.phone? (I don’t know if it’s called that)
recipe-list is the place where the crime occurred..
data is the place where json is stored
Anything with the app keyword is the root module root setting or something like that
为情所困2017-05-15 17:12:58
Post the code, brother, or the github address! Uncoded hanging inspection. . . . .
仅有的幸福2017-05-15 17:12:58
The problem has been solved.. There was an error when building the RESTful service. isArray is missing an a. I only found out after checking it for the fourth time. I admire myself for not giving up, and thank you all for taking the trouble to pay attention!