search

Home  >  Q&A  >  body text

angular.js - Some questions in angularjs documentation

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?

为情所困为情所困2867 days ago522

reply all(1)I'll reply

  • 仅有的幸福

    仅有的幸福2017-05-15 16:59:01

    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";
       }
    });

    reply
    0
  • Cancelreply