javascript - angular bootstrap with ng-include -



javascript - angular bootstrap with ng-include -

added plunkr http://plnkr.co/edit/9wtnw0?p=preview

just switch between ng-include , embedded div based approach in html

html

<div id="attendee" ng-include src="'js/view/partials/attendee.html'"></div>

or

<ng-include id="attendee" src="'js/view/partials/attendee.html'"></ng-include>

javascript

var self = this; angular.module('demo', []) .controller("attendeecontroller", function($scope, $location){self.attendeescontroller($scope, angular.bootstrap(document.getelementbyid("attendee"), ['demo']);

it works fine see error on console line triggers bootstrap.

typeerror: object not function

however if i've embedded html, no error

<div id="attendee"> <ul data-ng-controller="attendeecontroller"> <li data-ng-repeat="attendee in attendees"> <a href="#/attendees/{{attendee.id}}" target="_self">{{attendee.firstname}}</a> </li> </ul> </div>

just rid of stupid popup blocker in chrome , work fine, weird.

javascript angularjs angularjs-ng-include

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -