Angularjs Routes ng-views

17 views
Skip to first unread message

Milton Medina

unread,
Aug 23, 2017, 11:53:49 AM8/23/17
to web2py-users
Sorry I am new and little English, my question is how I can load a fraction of html within my template index through angular in web2py.
My code is as follows
App / static / js / AngularController
ControllerAngular:

     
App.config (['$ routeProvider', function ($ routeProvider)
  {

     $ RouteProvider
     .when ("/ hi", {
         TemplateUrl: "/hi.html",
     .otherwise ({
         RedirectTo: "/",
         TemplateUrl: "test.html",

      })
  }

App / views / default / index
My index
<? Left_sidebar_enabled, right_sidebar_enabled = False, ('message' in globals ())?>
<? Extend 'layout.html'?>
<? Block header?>

<Div class = "service-list-col2" ng-controller = "routeProvider">
          <H3> <a href="#/hi"> test </a> </ h3>
</ Div>
<Figure class = "col-lg-9 col-sm-7 wow fadeInUp delay-02s">
        <Div ng-view> </ div>
</ Figure>

And the layout already has the data-ng-app = "myApp"

thank you in advance
Reply all
Reply to author
Forward
0 new messages