Become a member
to unlock all features

Level Up!

Access all courses & lessons on egghead today and lock-in your price for life.


    No Custom Markup


    Extending the semantics of HTML is one of the core features of AngularJS, however, you can use AngularJS without any custom markup.



    Become a Member to view code

    You must be a Pro Member to view code

    Access all courses and lessons, track your progress, gain confidence and expertise.

    Become a Member
    and unlock code for this lesson
    orLog In




    John Lindquist: While we're on the subject of using Bootstrap and sort of NG app to initialize your app, it's worthwhile to mention, even though I don't recommend this practice, that you don't have to use any custom elements or attributes at all for your directives.

    If I were to create a controller, like an app controller -- we'll say "math.random", you might wonder, "Where am I going to put this controller if I can't use ng controller?" The way you could use this is if you use a directive. We'll just call this "app", and we'll return an object which restricts to a class -- you may see where I'm going now with controller of app control as app.

    From here if I simply give this a class of app and then look up my app.random this way, that should work the exact same way. You could build your whole application using classes for your directives, setting up controllers through your classes, whether just using the controller or linking functions and everything that you'd typically use in a directive.

    You could have a completely clean dom with no ngApp, no ng controller, no ng anything and still use the bindings and everything you're used to. Again, I don't recommend that way. I prefer my dom to be more descriptive of what the app is actually doing, but if this is the way you really want to do it, it is an option.