angular.js - Some questions in angularjs documentation
为情所困
为情所困 2017-05-15 16:57:01
0
1
497

For example, this page:
https://code.angularjs.org/1.4.7/docs/api/ngRoute/provider/$routeProvider

In the route parameter of the when method of $routeProvider, what do the strings that identify the type of each attribute mean?

template – {string=|function()=}
    {Array.<Object>}
    
resolve - {Object.<string, function>=}
What does "

function()=" in {string=|function()=} mean?
{Array.<Object>} What does it mean? What does
“function>=” in {Object.<string, function>=} mean?

为情所困
为情所困

reply all(1)
仅有的幸福

The template parameter can be a hard-coded string or a dynamic function, such as:

$route.when("/user", {
   template: "tpl-user.html"
});
$route.when("/user", {
   template: function(params) {
      return "tpl-user.html";
   }
});
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template